databricks-cli/bundle/internal/tf/codegen/generator/util.go

14 lines
261 B
Go

package generator
import (
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
)
// sortKeys returns a sorted copy of the keys in the specified map.
func sortKeys[M ~map[K]V, K string, V any](m M) []K {
keys := maps.Keys(m)
slices.Sort(keys)
return keys
}