Documentation ¶
Index ¶
- func Chunk[T interface{}](total int, preferred []T) [][]T
- func ChunkFor[T interface{}](items []T, itemsAmount int) [][]T
- func Clone[S ~[]E, E any](s S) S
- func Compare[E constraints.Ordered](s1, s2 []E) int
- func CompareFunc[E1, E2 any](s1 []E1, s2 []E2, cmp func(E1, E2) int) int
- func Equal[E comparable](s1, s2 []E) bool
- func EqualFunc[E1, E2 any](s1 []E1, s2 []E2, eq func(E1, E2) bool) bool
- func Find[T any](opts FindOpts[T]) []T
- func FindOne[T any](opts FindOpts[T]) T
- func GetCrossOfSlices[T any](s1, s2 []T, compare func(T, T) bool) []T
- func Includes[...](values []T, v T) bool
- func Map[Input, Output any](src []Input, cb MapCallback[Input, Output]) ([]Output, error)
- func Merge[T any](in ...[]T) []T
- func Paginate[T any](in []T, offset int, limit int) []T
- func Pop[T any](in []T, index int) []T
- func RandomValueOfSlice[T any](randSrc func(float64) (float64, error), in []T) (T, error)
- func RandomValueOfSliceNorm[T any](meanIndex float64, in []T) (T, error)
- func RandomValuesOfSlice[T any](randSrc func(float64) (float64, error), in []T, amount int) ([]T, error)
- func Shuffle[T any](in []T) []T
- func SliceToAnySlice[T any](in []T) []any
- func Unique[...](sl []T) []T
- func UniqueNestedSlice[...](sl [][]T, index int) [][]T
- type FindOpts
- type MapCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare[E constraints.Ordered](s1, s2 []E) int
func CompareFunc ¶
func Equal ¶
func Equal[E comparable](s1, s2 []E) bool
func GetCrossOfSlices ¶
func Map ¶
func Map[Input, Output any](src []Input, cb MapCallback[Input, Output]) ([]Output, error)
func RandomValueOfSlice ¶
func RandomValueOfSliceNorm ¶
func RandomValuesOfSlice ¶
func SliceToAnySlice ¶
Types ¶
type MapCallback ¶
Click to show internal directories.
Click to hide internal directories.