maps

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsValue

func ContainsValue[K, V comparable](haystack map[K]V, needle V) bool

ContainsValue scans the comparable values of a map for the input value

func Copy

func Copy[K comparable, V any](to map[K]V, from map[K]V)

Copy copies the elements of the second map to the first

func Inverse

func Inverse[K comparable, V comparable](in map[K]V) map[V]K

Inverse creates a map by inversing the keys with the values to enable searching a key by the value

func Keys

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

Keys returns all keys of the input map

func RepeatValue

func RepeatValue[K comparable, V any](keys []K, val V) map[K]V

RepeatValue creates a map where the input keys map to the same value

func SubMap

func SubMap[K comparable, V any](m map[K]V, ks ...K) (map[K]V, []K)

SubMap returns a new map that contains only the key-values of the input map that correspond to the input keys

func Values

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

Values returns all values of the input map

Types

This section is empty.

Jump to

Keyboard shortcuts

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