Documentation
¶
Index ¶
- func Keys[T comparable, V any](m map[T]V) []T
- func KeysEqual[T comparable, V any](m1, m2 map[T]V) bool
- func KeysFunc[T comparable, V any](m map[T]V, f func(k T) (T, bool)) []T
- func NewConMap[K comparable, V any](cap int) *conMap[K, V]
- func Range[K comparable, V any](m map[K]V, f func(k K, v V) bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Keys ¶
func Keys[T comparable, V any](m map[T]V) []T
Keys returns the keys of the map m as a slice. The keys are in an undefined order. The map m must be of type map[T]V, where T is comparable, or the function panics. The function returns a slice of type []T.
func KeysEqual ¶
func KeysEqual[T comparable, V any](m1, m2 map[T]V) bool
MapsEqual returns true if both maps have the same keys and corresponding values, and false otherwise.
Maps of type map[T]V are considered equal if they have the same number of elements and each element in m1 is in m2 with the same value, and vice versa. The order of the elements is not significant.
Both m1 and m2 must be of type map[T]V, or the function panics. The function returns a bool.
func KeysFunc ¶
func KeysFunc[T comparable, V any](m map[T]V, f func(k T) (T, bool)) []T
func NewConMap ¶
func NewConMap[K comparable, V any](cap int) *conMap[K, V]
func Range ¶
func Range[K comparable, V any](m map[K]V, f func(k K, v V) bool)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.