Documentation ¶
Overview ¶
Package xmaps provides more generic functions in the spirit of the maps package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init[M ~map[K]V, K comparable, V any](m M) M
Init clears m and returns m if m != nil or returns a new map otherwise.
func SetDefault ¶
func SetDefault[M ~map[K]V, K comparable, V any](m M, k K, defaultValue V) V
SetDefault returns m[k] or if m does not contain k, then SetDefault sets m[k] to defaultValue and returns defaultValue.
func SortedKeys ¶
SortedKeys returns a slice of the map's keys in sorted order.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.