13 lines
293 B
Go
13 lines
293 B
Go
package helper
|
|
|
|
import "sort"
|
|
|
|
// Helper function to get sorted keys from a map
|
|
func SortMapKeys(data map[string]interface{}) []string {
|
|
keys := make([]string, 0, len(data))
|
|
for key := range data {
|
|
keys = append(keys, key)
|
|
}
|
|
sort.Strings(keys) // Sort keys alphabetically
|
|
return keys
|
|
}
|