From d0d7d061b65e1ac8ea52a4a06ac82ba0656eb340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 21 Jun 2025 00:43:46 +0300 Subject: [PATCH] refactor: use stdlib maps (#942) --- go.mod | 1 - internal/maps/maps.go | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 3b92120..c0cea4f 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/internal/maps/maps.go b/internal/maps/maps.go index dbee51a..3e797aa 100644 --- a/internal/maps/maps.go +++ b/internal/maps/maps.go @@ -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 }