moremaps

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 3 Imported by: 1

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.

Jump to

Keyboard shortcuts

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