Documentation
¶
Index ¶
- func Clone[K comparable, V any](m map[K]V, n ...int) map[K]V
- func Copy[K comparable, V any](dst, src map[K]V)
- func Equal[K comparable, V comparable](a map[K]V, b map[K]V) bool
- func EqualFunc[K comparable, V1, V2 any](m1 map[K]V1, m2 map[K]V2, eq func(V1, V2) bool) bool
- func Keys[K comparable, V any](m map[K]V) []K
- func Merge[K comparable, V any](ms ...map[K]V) map[K]V
- func Reverse[K comparable, V comparable](m map[K]V) map[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 Clone ¶ added in v1.2.9
func Clone[K comparable, V any](m map[K]V, n ...int) map[K]V
Clone returns a copy of the map with additional +n cap. The elements are copied using assignment, so this is a shallow clone.
func Copy ¶ added in v1.0.15
func Copy[K comparable, V any](dst, src map[K]V)
Copy copy src map to dst map.
func Equal ¶ added in v1.0.12
func Equal[K comparable, V comparable](a map[K]V, b map[K]V) bool
Equal check equal for two map a and b.
func EqualFunc ¶ added in v1.2.9
func EqualFunc[K comparable, V1, V2 any](m1 map[K]V1, m2 map[K]V2, eq func(V1, V2) bool) bool
EqualFunc is like Equal, but compares values using eq. Keys are still compared with ==.
func Keys ¶ added in v1.0.27
func Keys[K comparable, V any](m map[K]V) []K
Keys return the slice of map's key
func Merge ¶
func Merge[K comparable, V any](ms ...map[K]V) map[K]V
Merge merge all map `ms`, return the merged map.
func Reverse ¶
func Reverse[K comparable, V comparable](m map[K]V) map[V]K
Reverse reverse key/value from map m, return the reversed map
func Values ¶ added in v1.0.27
func Values[K comparable, V any](m map[K]V) []V
Values return the slice of map's value
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.