maps

package
v0.0.0-...-d8850a5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

maps

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

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

Clear 清空

func Clone

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

Clone 克隆,浅层克隆

func Copy

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

Copy 复制src中的所有键/值对,并将它们添加到dst中

func DeleteFunc

func DeleteFunc[M ~map[K]V, K comparable, V any](m M, del func(K, V) bool)

DeleteFunc 从map中删除所有del函数返回true的键/值对

func Equal

func Equal[M1, M2 ~map[K]V, K, V comparable](m1 M1, m2 M2) bool

Equal 判断map是否相同

func EqualFunc

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

EqualFunc 判断map是否相同, 但使用eq比较值

func Keys

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

Keys 获取map的键

func Values

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

Values 获取map的值

Types

This section is empty.

Jump to

Keyboard shortcuts

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