Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromSlice ¶ added in v0.1.11
func FromSlice[T any, K comparable, V any](vs []T, f func(v T) (K, V)) map[K]V
FromSlice constructs a map by using f to extract keys and values from the given slice. NOTE: if f returns the same key multiple times, the map will contain the value of the last element in the slice for which f returns that key.
func Keys ¶ added in v0.1.0
func Keys[K comparable, V any](m map[K]V) []K
func Map ¶ added in v0.1.6
func Map[K comparable, V any, T any](m map[K]V, f func(K, V) T) []T
func Values ¶ added in v0.1.5
func Values[K comparable, V any](m map[K]V) []V
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.