dict

package
v1.121.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: MPL-2.0 Imports: 0 Imported by: 8

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL