mirror of
https://github.com/goreleaser/nfpm.git
synced 2026-06-19 08:05:04 +00:00
refactor: use stdlib maps (#942)
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user