Documentation ¶
Index ¶
- func Chunk[T any](collection []T, size int) [][]T
- func Filter[V any](collection []V, predicate func(V, int) bool) []V
- func Map[T any, R any](collection []T, iteratee func(T, int) R) []R
- func Shuffle[T any](collection []T) []T
- func Subset[T any](collection []T, offset int, limit uint) []T
- func Uniq[T comparable](collection []T) []T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter iterates over elements of collection, returning an array of all elements predicate returns truthy for.
func Shuffle ¶
func Shuffle[T any](collection []T) []T
Shuffle returns an array of shuffled values. Uses the Fisher-Yates shuffle algorithm.
func Uniq ¶
func Uniq[T comparable](collection []T) []T
Uniq returns a duplicate-free version of an array
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.