Documentation
¶
Index ¶
- func Any[T any](slice []T, predicate func(input T) bool) bool
- func Filter[T any](slice []T, predicate func(input T) bool) []T
- func Find[T any](slice []T, predicate func(input T) bool) *T
- func Map[F any, T any](slice []F, mapper func(input F) T) []T
- func PrettyXML(input []byte) ([]byte, error)
- func RandomList[T any](maxLength int, gen func() T) []T
- func RandomString() string
- func RandomStringWithLength(length int) string
- func RandomTime() time.Time
- type XMLElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter the given slice, keeping only the ones that cause the predicate to return true.
func Find ¶
Find the first element in the given slice that causes the predicate to return true; if not found, returns nil.
func RandomList ¶
RandomList returns a random list with a length no more than specified, where each element is generated with the given function.
func RandomString ¶
func RandomString() string
RandomString returns a random non-empty string of an unspecified length
func RandomStringWithLength ¶
RandomStringWithLength returns a random string with a given length
Types ¶
type XMLElement ¶
Click to show internal directories.
Click to hide internal directories.