zmap

package
v0.0.0-...-826b370 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 2 Imported by: 5

Documentation

Overview

Package zmap implements generic functions for maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyValue

func KeyValue[M ~map[K]V, K comparable, V any](m M) []struct {
	K K
	V V
}

KeyValue returns a struct slice with the keys and values.

func Keys

func Keys[M ~map[K]V, K cmp.Ordered, V any](m M) []K

Keys returns an unsorted list of keys of the map.

func KeysOrdered

func KeysOrdered[M ~map[K]V, K cmp.Ordered, V any](m M) []K

KeysOrdered returns the sorted keys of the map.

func LongestKey

func LongestKey[M ~map[string]V, V any](m M) ([]string, int)

LongestKey returns the longest key in this map and the unsorted list of all keys.

func Values

func Values[M ~map[K]V, K comparable, V any](m M) []V

Values returns the values of the map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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