Documentation ¶
Overview ¶
moremaps impements extensions to the standard maps library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortedKeys ¶
func SortedKeys[K SortableKey, V any](m map[K]V) []K
SortableKeys returns a new slice of the map's keys in their natural order.
func SortedKeysFunc ¶
func SortedKeysFunc[K comparable, V any](m map[K]V, f func(K, K) int) []K
SortableKeysFunc returns a new slice of the map's keys ordered according to the provided function.
Types ¶
type SortableKey ¶
type SortableKey interface { comparable cmp.Ordered }
SortableKey is a type constraint that captures all map keys that are naturally sortable.
Click to show internal directories.
Click to hide internal directories.