Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Keys ¶
func Keys[M ~map[K]V, K comparable, V any](m M) []K
Keys returns the keys of the map m. The keys will be in an indeterminate order.
func MapByKey ¶ added in v1.108.0
func MapByKey[T any, K comparable](data []T, keyFunc func(T) K) map[K]T
MapByKey returns a map of the values in 'data' keyed by the result of keyFunc. If there are duplicate keys, the last value in data with that key will be the one in the map.
func MapOfSlicesByKey ¶ added in v1.108.0
func MapOfSlicesByKey[T any, K comparable](data []T, keyFunc func(T) K) map[K][]T
MapOfSlicesByKey returns a map of the values in 'data' keyed by the result of keyFunc. Duplicate keys will have their values appended to a slice in the map.
func Values ¶
func Values[M ~map[K]V, K comparable, V any](m M) []V
Values returns the values of the map m. The values will be in an indeterminate order.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.