Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
func Contains[T comparable](slice []T, e T) bool
Contains returns true if a slice contains an element
func Map ¶ added in v0.1.2
func Map[K comparable, V any](slice []V, fn func(V) K) map[K]V
Map takes a slice of a given type and a function to extract a map key from slice elements; it returns a map of these keys to the original element. Note that if multiple elements in the slice return the same key, the element that appears last in the slice will be the (only) element that maps to the key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.