SortedMapKeys takes a map with keys of type string and returns a slice of those keys sorted lexicographically.
(m map[string]T)
| 347 | // SortedMapKeys takes a map with keys of type string and returns a slice of those |
| 348 | // keys sorted lexicographically. |
| 349 | func SortedMapKeys[T any](m map[string]T) []string { |
| 350 | keys := make([]string, 0, len(m)) |
| 351 | for k := range m { |
| 352 | keys = append(keys, k) |
| 353 | } |
| 354 | slices.Sort(keys) |
| 355 | return keys |
| 356 | } |
| 357 | |
| 358 | // SortedSchemaKeys returns the keys of the given SchemaRef dictionary in sorted |
| 359 | // order, since Golang scrambles dictionary keys. This isn't a generic key sort, because |
no outgoing calls
no test coverage detected