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

@@ -20,10 +20,11 @@ import (
"fmt"
"io"
"log"
"maps"
"os"
"path/filepath"
"runtime"
"sort"
"slices"
"strconv"
"strings"
"sync"
@@ -76,12 +77,7 @@ func LogCurrent(logf logf) {
mu.Lock()
defer mu.Unlock()
list := make([]string, 0, len(set))
for k := range set {
list = append(list, k)
}
sort.Strings(list)
for _, k := range list {
for _, k := range slices.Sorted(maps.Keys(set)) {
logf("envknob: %s=%q", k, set[k])
}
}