maps

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Keys

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

Keys returns keys of the map.

func MapKeys added in v0.3.3

func MapKeys[K1 comparable, V any, K2 comparable](m1 map[K1]V, f func(K1) K2, combine func(V, V) V) (m2 map[K2]V)

MapKeys converts original keys to new keys.

func MapValues added in v0.3.6

func MapValues[K comparable, A any, B any](m map[K]A, f func(A) B) (res map[K]B)

MapValues converts values in the map using the provided function.

func Merge

func Merge[K comparable, V any](m1 map[K]V, m2 map[K]V, combine func(V, V) V) (m map[K]V)

Merge combines two maps. Function `combine` is invoked when the same key is available in both maps.

Types

This section is empty.

Jump to

Keyboard shortcuts

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