Documentation
¶
Index ¶
- func ContainsAllKeys[K comparable, V any, M ~map[K]V](m M, keys []K) bool
- func ContainsAnyKey[K comparable, V any, M ~map[K]V](m M, keys []K) bool
- func KeyVals[K comparable, V any, M ~map[K]V](m M) ([]K, []V)
- func Keys[K comparable, V any, M ~map[K]V](m M) []K
- func Merge[K comparable, V any, M ~map[K]V](ms ...M) map[K]V
- func SortedKeys[K cmp.Ordered, V any, M ~map[K]V](m M) []K
- func SortedVals[K comparable, V cmp.Ordered, M ~map[K]V](m M) []V
- func Vals[K comparable, V any, M ~map[K]V](m M) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsAllKeys ¶ added in v0.0.62
func ContainsAllKeys[K comparable, V any, M ~map[K]V](m M, keys []K) bool
ContainsAllKeys checks whether all given keys exist in the target map.
func ContainsAnyKey ¶ added in v0.0.62
func ContainsAnyKey[K comparable, V any, M ~map[K]V](m M, keys []K) bool
ContainsAnyKey checks whether at least one of the given keys exists in the target map.
func KeyVals ¶
func KeyVals[K comparable, V any, M ~map[K]V](m M) ([]K, []V)
KeyVals returns the keys and values from a map in indeterminate order.
func Keys ¶
func Keys[K comparable, V any, M ~map[K]V](m M) []K
Keys returns the all keys of a map. The keys returned are in indeterminate order. As of Go 1.23, you can also use standard library https://pkg.go.dev/maps#Keys.
func Merge ¶ added in v0.0.61
func Merge[K comparable, V any, M ~map[K]V](ms ...M) map[K]V
Merge merges multiple maps into a new map.
func SortedKeys ¶
SortedKeys returns the keys from a map in ascending order.
func SortedVals ¶
func SortedVals[K comparable, V cmp.Ordered, M ~map[K]V](m M) []V
SortedVals returns the values from a map in ascending order.
func Vals ¶
func Vals[K comparable, V any, M ~map[K]V](m M) []V
Vals returns a slice of all the values in m. The values returned are in indeterminate order. As of Go 1.23, you can also use standard library https://pkg.go.dev/maps#Values.
Types ¶
This section is empty.