bzmap

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contain

func Contain[K comparable, V any](m map[K]V, value V) bool

Contain 判断泛型map是否包含某值 func Contain[K comparable, V any](m map[K]V, value V) bool @param m map[K]V 查找的map @param value V 包含的目标值 @return bool 是否包含

func MatchMapFunc

func MatchMapFunc[K comparable, V any](m1 map[K]V, m2 map[K]V, fn func(m1Key K, m1Value V, m2Key K, m2Value V) bool) bool

MatchMapFunc 判断两个map是否符合自定义匹配 MatchMapFunc[K comparable, V any](m1 map[K]V, m2 map[K]V, fn func(m1Key K, m1Value V, m2Key K, m2Value V) bool) bool @param m1 map[K]V 匹配的map 1 @param m2 map[K]V 匹配的map 2 @param fn func(m1Key K, m1Value V, m2Key K, m2Value V) bool 自定义匹配函数 @return bool 是否匹配

func MatchSliceFunc

func MatchSliceFunc[K comparable, V any](m1 map[K]V, m2 []V, fn func(m1Key K, m1Value V, m2Value V) bool) bool

MatchSliceFunc 判断map和slice是否符合自定义匹配 MatchSliceFunc[K comparable, V any](m1 map[K]V, m2 []V, fn func(m1Key K, m1Value V, m2Value V) bool) bool @param m1 map[K]V 匹配的map @param m2 map[K]V 匹配的slice @param fn func(m1Key K, m1Value V, m2Value V) bool 自定义匹配函数 @return bool 是否匹配

func ToMap

func ToMap[K comparable, V any](v any) (map[K]V, error)

func ToSlice

func ToSlice[K comparable, V any, I any](m map[K]V, fn func(key K, val V) I) []I

Types

This section is empty.

Jump to

Keyboard shortcuts

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