Documentation ¶
Index ¶
- func Clone[M ~map[K]V, K comparable, V any](m M) M
- func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool
- func Keys[M ~map[K]V, K comparable, V any](m M) []K
- func MergeCopy[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](base M1, override M2) M1
- func Values[M ~map[K]V, K comparable, V any](m M) []V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
func Clone[M ~map[K]V, K comparable, V any](m M) M
Clone returns a copy of the slice. The elements are copied using assignment, so this is a shallow clone.
func Equal ¶
func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool
Equal reports whether two maps contain the same key/value pairs. Values are compared using ==.
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 MergeCopy ¶
func MergeCopy[M1 ~map[K]V, M2 ~map[K]V, K comparable, V any](base M1, override M2) M1
MergeCopy creates a new map by merging all key/value pairs from base and override. When a key in override is already present in base, the value in base will be overwritten by the value associated with the key in override.
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.