refactor: use stdlib maps (#942)

This commit is contained in:
Ville Skyttä
2025-06-21 00:43:46 +03:00
committed by GitHub
parent 3b9e98a8ab
commit d0d7d061b6
2 changed files with 4 additions and 6 deletions
-1
View File
@@ -22,7 +22,6 @@ require (
github.com/spf13/cobra v1.9.1
github.com/stretchr/testify v1.10.0
github.com/ulikunitz/xz v0.5.12
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
gopkg.in/yaml.v3 v3.0.1
)
+4 -5
View File
@@ -1,13 +1,12 @@
package maps
import (
"sort"
"golang.org/x/exp/maps"
"maps"
"slices"
)
func Keys[T any](m map[string]T) []string {
keys := maps.Keys(m)
sort.Strings(keys)
keys := slices.Collect(maps.Keys(m))
slices.Sort(keys)
return keys
}