filename rename And unit test cover

This commit is contained in:
libin
2023-03-22 00:06:31 +08:00
parent 6e6ef5c774
commit 708c2166c6
32 changed files with 636 additions and 188 deletions

17
mapUtil/map_exists.go Normal file
View File

@@ -0,0 +1,17 @@
package mapUtil
// MapValueExists 判断map中的value是否存在
func MapValueExists(m map[string]interface{}, value interface{}) bool {
for _, v := range m {
if v == value {
return true
}
}
return false
}
// MapKeyExists 判断map中的key是否存在
func MapKeyExists(m map[string]interface{}, key string) bool {
_, exists := m[key]
return exists
}