INNER CODE UNIT · Go
SortedKeys
bjw-s-labs/helm-charts · tools/helm-schema-tools/internal/schema/schema.go:103
func SortedKeys(m map[string]*jsonschema.Schema) []string {
return slices.Sorted(maps.Keys(m))
}
// MakeSet converts a string slice into a set for O(1) membership testing.
func MakeSet(slice []string) map[string]bool {
set := make(map[string]bool, len(slice))
for _, s := range slice {
set[s] = true
}
return set
}
// DeduplicateStrings returns a new slice with duplicates removed while
// preserving the order of first occurrence.
func DeduplicateStrings(in []string) []string {
seen := make(map[string]struct{}, len(in))
out := make([]string, 0, len(in))