Documentation
¶
Overview ¶
Package slices contains functions for working with slices.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[S ~[]E, E comparable](s S, e E) bool
Contains returns true if e is in s.
func Filter ¶
Filter returns a new slice containing only those elements for which f(element) is true.
func Reverse ¶ added in v0.22.2
func Reverse[S ~[]E, E comparable](s S)
Reverse reverses a slice's order.
func UniqueBy ¶ added in v0.22.2
func UniqueBy[S ~[]E, E any, V comparable](s S, by func(E) V) S
UniqueBy returns the unique elements of s using a function to map elements.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.