Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter [Filter[T]] is a function that takes a slice of type T and a function that takes a value of type T and returns a boolean. It returns a new slice containing only the elements of the input slice for which the function returns true.
func Map ¶
func Map[In, Out any](s []In, fn func(In) Out) []Out
Map applies a given function to each element of a slice[[]], returning a new slice[] with the results. The function takes an element of the input slice as its argument and returns the corresponding element of the output slice[].
func NoZero ¶
func NoZero[S ~[]T, T comparable](s S) S
NoZero removes all zero values from a given slice [S] of comparable type [T]. It returns a new slice with only the non-zero values.
func Unique ¶
func Unique[S ~[]T, T comparable](s S) S
Unique returns a new slice with only the unique elements of the input slice. The function accepts a slice of type [S ~[]T, T comparable](S), where T is a comparable type. The resulting slice has the same underlying type as the input slice.
Types ¶
This section is empty.