diff options
| author | Joe Tsai <joetsai@digital-static.net> | 2024-10-11 11:41:09 -0700 |
|---|---|---|
| committer | Joe Tsai <joetsai@digital-static.net> | 2024-10-11 11:41:09 -0700 |
| commit | 8f86d4f8b909f9484d0d0f96ecfd4e4f434797af (patch) | |
| tree | 9b83c6983fca87437950f57a9d7618f0e3f2b653 /cmd | |
| parent | c763b7a7db6c3e3f35ed973881108c5adef7bae8 (diff) | |
| download | tailscale-dsnet/slices-collect.tar.xz tailscale-dsnet/slices-collect.zip | |
all: use slices.Collect with maps.Keys instead of xmaps.Keysdsnet/slices-collect
In Go 1.23, the standard maps.Keys helper was altered relative to xmaps.Keys
to return and iterator, which can be used with slices.Collect.
Also, Go 1.21 added the clear built-in, which replaces xmaps.Clear,
and is semantically more correct with respect to NaNs.
Updates #8632
Updates #12912
Updates #cleanup
Signed-off-by: Joe Tsai <joetsai@digital-static.net>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/tailscale/cli/exitnode.go | 4 | ||||
| -rw-r--r-- | cmd/testwrapper/testwrapper.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/cmd/tailscale/cli/exitnode.go b/cmd/tailscale/cli/exitnode.go index 6b9247a7b..d41e42092 100644 --- a/cmd/tailscale/cli/exitnode.go +++ b/cmd/tailscale/cli/exitnode.go @@ -9,13 +9,13 @@ import ( "errors" "flag" "fmt" + "maps" "slices" "strings" "text/tabwriter" "github.com/kballard/go-shellquote" "github.com/peterbourgon/ff/v3/ffcli" - xmaps "golang.org/x/exp/maps" "tailscale.com/envknob" "tailscale.com/ipn/ipnstate" "tailscale.com/tailcfg" @@ -255,7 +255,7 @@ func filterFormatAndSortExitNodes(peers []*ipnstate.PeerStatus, filterBy string) } filteredExitNodes := filteredExitNodes{ - Countries: xmaps.Values(countries), + Countries: slices.Collect(maps.Values(countries)), } for _, country := range filteredExitNodes.Countries { diff --git a/cmd/testwrapper/testwrapper.go b/cmd/testwrapper/testwrapper.go index 9b8d7a7c1..75db00736 100644 --- a/cmd/testwrapper/testwrapper.go +++ b/cmd/testwrapper/testwrapper.go @@ -16,6 +16,7 @@ import ( "fmt" "io" "log" + "maps" "os" "os/exec" "slices" @@ -29,7 +30,6 @@ import ( "github.com/dave/courtney/tester" "github.com/dave/patsy" "github.com/dave/patsy/vos" - xmaps "golang.org/x/exp/maps" "tailscale.com/cmd/testwrapper/flakytest" ) @@ -343,7 +343,7 @@ func main() { if len(toRetry) == 0 { continue } - pkgs := xmaps.Keys(toRetry) + pkgs := slices.Collect(maps.Keys(toRetry)) sort.Strings(pkgs) nextRun := &nextRun{ attempt: thisRun.attempt + 1, |
