+ add Map2KeySlice

This commit is contained in:
gazebo
2019-03-01 10:13:42 +08:00
parent 12b671d92f
commit ac19798d33

View File

@@ -372,3 +372,12 @@ func Format4Output(obj interface{}, isSingleLine bool) (retVal string) {
}
return retVal
}
func Map2KeySlice(flagMap map[string]int) (keyList []string) {
for k, v := range flagMap {
if v != 0 {
keyList = append(keyList, k)
}
}
return keyList
}