Documentation
¶
Index ¶
- func Contain[K comparable, V any](m map[K]V, value V) bool
- 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
- func MatchSliceFunc[K comparable, V any](m1 map[K]V, m2 []V, fn func(m1Key K, m1Value V, m2Value V) bool) bool
- func ToMap[K comparable, V any](v any) (map[K]V, error)
- func ToSlice[K comparable, V any, I any](m map[K]V, fn func(key K, val V) I) []I
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 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.