Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
func Convert[A, B any, S ~[]B](v S) []A
Convert converts a slice of type B to a slice of type A. Convert panics if B cannot be type asserted to type A.
func DeleteVal ¶
func DeleteVal[E any](s []E, v E) []E
DeleteVal deletes the first occurrence of a value in a slice of the type E and returns a new slice without the value.
func Filter ¶ added in v0.8.0
Filter iterates over elements of collection, returning an array of all elements function c returns true for.
func Index ¶
Index returns the index of the first occurrence of v in s, or -1 if not present. Index accepts any type, as opposed to slices.Index, but might panic if E is not comparable.
func SearchValue ¶ added in v0.8.4
SearchValue iterates through slice v, calling function f for every element. If true is returned in this function, the respective element is returned and ok is true. If the function f does not return true for any element, false is returned.
Types ¶
This section is empty.