maps

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 2 Imported by: 1

README

maps is a map utilities library

In current form the lib is incredibly small. I may build it up over time.

If you need a sorted map and require performance, consider a btree.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortKeys

func SortKeys[K constraints.Ordered, V any](m map[K]V) []K

SortKeys sorts the keys of a map.

Types

type KeyVal

type KeyVal[K constraints.Ordered, V any] struct {
	Key K
	Val V
}

KeyVal is a Key Value pair.

type KeyVals

type KeyVals[K constraints.Ordered, V any] []KeyVal[K, V]

func SortByKeys

func SortByKeys[K constraints.Ordered, V any](m map[K]V) KeyVals[K, V]

Sort sorts a map by key, returning a slice of KV structs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL