rename MapKeys
This commit is contained in:
parent
2867e9b911
commit
b8a47fbf1d
10
str.go
10
str.go
@ -64,8 +64,8 @@ func SkipLine(s string, n int) string {
|
|||||||
return Skip(s, "\n", n)
|
return Skip(s, "\n", n)
|
||||||
}
|
}
|
||||||
|
|
||||||
// get a map keys as array.
|
// get a map's keys as array.
|
||||||
func MapKeys(imap interface{}) (keys []string) {
|
func MapsKeys(imap interface{}) (keys []string) {
|
||||||
switch imap.(type) {
|
switch imap.(type) {
|
||||||
case map[string]string:
|
case map[string]string:
|
||||||
m := imap.(map[string]string)
|
m := imap.(map[string]string)
|
||||||
@ -83,9 +83,9 @@ func MapKeys(imap interface{}) (keys []string) {
|
|||||||
return keys
|
return keys
|
||||||
}
|
}
|
||||||
|
|
||||||
// get a map keys and join to string.
|
// get a map's keys and join it to string.
|
||||||
func KeysString(imap interface{}) string {
|
func MapsKeysString(imap interface{}) string {
|
||||||
keys := Keys(imap)
|
keys := MapsKeys(imap)
|
||||||
return strings.Join(keys, ",")
|
return strings.Join(keys, ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user