Skip to content

Commit

Permalink
add utils.map
Browse files Browse the repository at this point in the history
  • Loading branch information
niean committed Aug 28, 2015
1 parent 7d271ef commit 6c2c250
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils/map.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package utils

// TODO 以下的部分, 考虑放到公共组件库
func KeysOfMap(m map[string]string) []string {
keys := make([]string, len(m))
i := 0
for key, _ := range m {
keys[i] = key
i++
}

return keys
}

0 comments on commit 6c2c250

Please sign in to comment.