mag

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone added in v1.2.9

func Clone[K comparable, V any](m map[K]V, n ...int) map[K]V

Clone returns a copy of the map with additional +n cap. The elements are copied using assignment, so this is a shallow clone.

func Copy added in v1.0.15

func Copy[K comparable, V any](dst, src map[K]V)

Copy copy src map to dst map.

func Equal added in v1.0.12

func Equal[K comparable, V comparable](a map[K]V, b map[K]V) bool

Equal check equal for two map a and b.

func EqualFunc added in v1.2.9

func EqualFunc[K comparable, V1, V2 any](m1 map[K]V1, m2 map[K]V2, eq func(V1, V2) bool) bool

EqualFunc is like Equal, but compares values using eq. Keys are still compared with ==.

func Keys added in v1.0.27

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

Keys return the slice of map's key

func Merge

func Merge[K comparable, V any](ms ...map[K]V) map[K]V

Merge merge all map `ms`, return the merged map.

func Reverse

func Reverse[K comparable, V comparable](m map[K]V) map[V]K

Reverse reverse key/value from map m, return the reversed map

func Values added in v1.0.27

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

Values return the slice of map's value

Types

This section is empty.

Jump to

Keyboard shortcuts

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