package maps

import "cuelang.org/go/internal/golangorgx/gopls/util/maps"

Index

Functions

func Group

func Group[K comparable, V any](s []V, key func(V) K) map[K][]V

Group returns a new non-nil map containing the elements of s grouped by the keys returned from the key func.

func Keys

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

Keys returns the keys of the map M.

func SameKeys

func SameKeys[K comparable, V1, V2 any](x map[K]V1, y map[K]V2) bool

SameKeys reports whether x and y have equal sets of keys.

Source Files

maps.go

Version
v0.12.0 (latest)
Published
Jan 30, 2025
Platform
linux/amd64
Last checked
8 hours ago

Tools for package owners.