genmap

package
v6.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package genmap provides generic functions for manipulating maps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](x T, ls []T) bool

Contains returns true if x is in ls

func MapValues added in v6.3.0

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

MapValues constructs a list of all values of the map in a non-deterministic order. NOTE: when used in the protocol functions, the values must be sorted.

func Pick

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

Pick creates a new map based on `m` by selecting entries from `keys`. If a key is in keys, but not map, then it's not included. Map keys and values are copied.

Types

This section is empty.

Jump to

Keyboard shortcuts

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