- add util func RemoveGeneralMapKeys
This commit is contained in:
@@ -201,3 +201,14 @@ func TrimBlanChar(str string) string {
|
||||
return strValue == " " || strValue == "\t" || strValue == "\n" || strValue == "\r"
|
||||
})
|
||||
}
|
||||
|
||||
func RemoveGeneralMapKeys(obj map[string]interface{}, keys ...string) map[string]interface{} {
|
||||
if obj != nil {
|
||||
for _, key := range keys {
|
||||
if _, ok := obj[key]; ok {
|
||||
delete(obj, key)
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user