Documentation
¶
Index ¶
- func Any[T any](ts []T) (T, bool)
- func Contains[T comparable](ts []T, t T) bool
- func ContainsAll[T comparable](ts []T, ts2 []T) bool
- func Filter[T any](ts []T, f func(i int, t T) bool) []T
- func Generate[T any](n int, f func(i int) T) []T
- func Repeat[T any](value T, n int) []T
- func Transform[T, R any](ts []T, f func(i int, t T) R) []R
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Any ¶ added in v0.2.0
Any returns an arbitrary element of the slice. If the slice is not empty, the second return value is true. Otherwise, Any returns the zero value of the slice's element type and false.
func Contains ¶ added in v0.3.5
func Contains[T comparable](ts []T, t T) bool
Contains returns true if the slice contains the given element.
func ContainsAll ¶ added in v0.3.5
func ContainsAll[T comparable](ts []T, ts2 []T) bool
ContainsAll returns true if the slice contains all elements of the given slice.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.