MCPcopy Create free account
hub / github.com/cloudwan/gohan / GetSortedKeys

Function GetSortedKeys

util/util.go:220–227  ·  view source on GitHub ↗

GetSortedKeys returns sorted keys of map[string]interface{}

(object map[string]interface{})

Source from the content-addressed store, hash-verified

218
219// GetSortedKeys returns sorted keys of map[string]interface{}
220func GetSortedKeys(object map[string]interface{}) []string {
221 keys := []string{}
222 for key := range object {
223 keys = append(keys, key)
224 }
225 sort.Sort(stringSlice(keys))
226 return keys
227}
228
229type stringSlice []string
230

Callers 1

util_test.goFile · 0.85

Calls 1

stringSliceTypeAlias · 0.85

Tested by

no test coverage detected