Documentation
¶
Index ¶
- func ContainsValue[K, V comparable](haystack map[K]V, needle V) bool
- func Copy[K comparable, V any](to map[K]V, from map[K]V)
- func Inverse[K comparable, V comparable](in map[K]V) map[V]K
- func Keys[K comparable, V any](m map[K]V) []K
- func RepeatValue[K comparable, V any](keys []K, val V) map[K]V
- func SubMap[K comparable, V any](m map[K]V, ks ...K) (map[K]V, []K)
- func Values[K comparable, V any](m map[K]V) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsValue ¶
func ContainsValue[K, V comparable](haystack map[K]V, needle V) bool
ContainsValue scans the comparable values of a map for the input value
func Copy ¶
func Copy[K comparable, V any](to map[K]V, from map[K]V)
Copy copies the elements of the second map to the first
func Inverse ¶
func Inverse[K comparable, V comparable](in map[K]V) map[V]K
Inverse creates a map by inversing the keys with the values to enable searching a key by the value
func RepeatValue ¶
func RepeatValue[K comparable, V any](keys []K, val V) map[K]V
RepeatValue creates a map where the input keys map to the same value
func SubMap ¶
func SubMap[K comparable, V any](m map[K]V, ks ...K) (map[K]V, []K)
SubMap returns a new map that contains only the key-values of the input map that correspond to the input keys
func Values ¶
func Values[K comparable, V any](m map[K]V) []V
Values returns all values of the input map
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.