mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
cmd/tailscale/cli: use new Go 1.23 slices.Sorted
And a grammatical nit. Updates #12912 Change-Id: I9feae53beb4d28dfe98b583373e2e0a43c801fc4 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
11d205f6c4
commit
bcc47d91ca
@ -6,6 +6,7 @@
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"maps"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@ -76,12 +77,7 @@ func runDNSStatus(ctx context.Context, args []string) error {
|
||||
if len(dnsConfig.Routes) == 0 {
|
||||
fmt.Println(" (no routes configured: split DNS might not be in use)")
|
||||
}
|
||||
routesKeys := make([]string, 0, len(dnsConfig.Routes))
|
||||
for k := range dnsConfig.Routes {
|
||||
routesKeys = append(routesKeys, k)
|
||||
}
|
||||
slices.Sort(routesKeys)
|
||||
for _, k := range routesKeys {
|
||||
for _, k := range slices.Sorted(maps.Keys(dnsConfig.Routes)) {
|
||||
v := dnsConfig.Routes[k]
|
||||
for _, r := range v {
|
||||
fmt.Printf(" - %-30s -> %v", k, r.Addr)
|
||||
|
Loading…
Reference in New Issue
Block a user