all: use new Go 1.23 slices.Sorted more

Updates #12912

Change-Id: If1294e5bc7b5d3cf0067535ae10db75e8b988d8b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-09-04 13:27:07 -07:00
committed by Brad Fitzpatrick
parent fd6686d81a
commit 3d401c11fa
4 changed files with 9 additions and 26 deletions

View File

@@ -7,12 +7,12 @@ import (
"bytes"
"context"
"fmt"
"maps"
"net"
"net/http"
"net/netip"
"reflect"
"slices"
"sort"
"strconv"
"strings"
"testing"
@@ -593,13 +593,7 @@ func TestMakeProbePlan(t *testing.T) {
func (plan probePlan) String() string {
var sb strings.Builder
keys := []string{}
for k := range plan {
keys = append(keys, k)
}
sort.Strings(keys)
for _, key := range keys {
for _, key := range slices.Sorted(maps.Keys(plan)) {
fmt.Fprintf(&sb, "[%s]", key)
pv := plan[key]
for _, p := range pv {