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[T any, K comparable, V any](slice []T, fn func(T) (K, V)) map[K]V
Map takes a slice of a given type and a function to extract a map key and value from slice elements, returns a new map with those key-value pairs. 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.