+ add Map2KeySlice
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user