aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/api')
-rw-r--r--src/cmd/api/api_test.go4
-rw-r--r--src/cmd/api/main_test.go18
2 files changed, 11 insertions, 11 deletions
diff --git a/src/cmd/api/api_test.go b/src/cmd/api/api_test.go
index ba358d364d..7848233333 100644
--- a/src/cmd/api/api_test.go
+++ b/src/cmd/api/api_test.go
@@ -11,7 +11,7 @@ import (
"internal/testenv"
"os"
"path/filepath"
- "sort"
+ "slices"
"strings"
"sync"
"testing"
@@ -77,7 +77,7 @@ func TestGolden(t *testing.T) {
t.Fatalf("opening golden.txt for package %q: %v", fi.Name(), err)
}
wanted := strings.Split(string(bs), "\n")
- sort.Strings(wanted)
+ slices.Sort(wanted)
for _, feature := range wanted {
if feature == "" {
continue
diff --git a/src/cmd/api/main_test.go b/src/cmd/api/main_test.go
index 10dbabb9b8..a0820c2274 100644
--- a/src/cmd/api/main_test.go
+++ b/src/cmd/api/main_test.go
@@ -25,7 +25,7 @@ import (
"path/filepath"
"regexp"
"runtime"
- "sort"
+ "slices"
"strconv"
"strings"
"sync"
@@ -232,8 +232,8 @@ func compareAPI(w io.Writer, features, required, exception []string) (ok bool) {
featureSet := set(features)
exceptionSet := set(exception)
- sort.Strings(features)
- sort.Strings(required)
+ slices.Sort(features)
+ slices.Sort(required)
take := func(sl *[]string) string {
s := (*sl)[0]
@@ -378,7 +378,7 @@ func (w *Walker) Features() (fs []string) {
for f := range w.features {
fs = append(fs, f)
}
- sort.Strings(fs)
+ slices.Sort(fs)
return
}
@@ -431,7 +431,7 @@ func tagKey(dir string, context *build.Context, tags []string) string {
// an indirect imported package. See https://github.com/golang/go/issues/21181
// for more detail.
tags = append(tags, context.GOOS, context.GOARCH)
- sort.Strings(tags)
+ slices.Sort(tags)
for _, tag := range tags {
if ctags[tag] {
@@ -535,7 +535,7 @@ func (w *Walker) loadImports() {
}
}
- sort.Strings(stdPackages)
+ slices.Sort(stdPackages)
imports = listImports{
stdPackages: stdPackages,
importMap: importMap,
@@ -717,7 +717,7 @@ func sortedMethodNames(typ *types.Interface) []string {
for i := range list {
list[i] = typ.Method(i).Name()
}
- sort.Strings(list)
+ slices.Sort(list)
return list
}
@@ -747,7 +747,7 @@ func (w *Walker) sortedEmbeddeds(typ *types.Interface) []string {
list = append(list, buf.String())
}
}
- sort.Strings(list)
+ slices.Sort(list)
return list
}
@@ -1083,7 +1083,7 @@ func (w *Walker) emitIfaceType(name string, typ *types.Interface) {
return
}
- sort.Strings(methodNames)
+ slices.Sort(methodNames)
w.emitf("type %s interface { %s }", name, strings.Join(methodNames, ", "))
}