Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chunk ¶
func Chunk[M ~map[K]V, K comparable, V any](m M, x int) []M
Chunk divides the map m into x parts and returns them as a list of chunks Useful for parallel processing of a map The ordering of keys between and within chunks is indeterminate If the chunks cannot contain the same number of keys, the last chunk will be longer If the map is not large enough to provide the requested number of chunks, a single chunk will be returned
func Clone ¶
func Clone[M ~map[K]V, K comparable, V any](m M) M
Clone returns a copy of the map m. The ordering of the returned map will be in an indeterminate order.
func Keys ¶
func Keys[M ~map[K]V, K comparable, V any](m M) []K
Keys returns the keys of the map m. The keys will be an indeterminate order.
func Values ¶
func Values[M ~map[K]V, K comparable, V any](m M) []V
Values returns the values of the map m. The values will be an indeterminate order.
Types ¶
This section is empty.