Skip to content

Commit bc0eb6b

Browse files
committed
all: import x/exp/maps as xmaps to distinguish from Go 1.21 "maps"
Updates tailscale#8419 Signed-off-by: Brad Fitzpatrick <[email protected]>
1 parent e8551d6 commit bc0eb6b

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

cmd/tailscale/cli/exitnode.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"text/tabwriter"
1515

1616
"github.com/peterbourgon/ff/v3/ffcli"
17-
"golang.org/x/exp/maps"
17+
xmaps "golang.org/x/exp/maps"
1818
"tailscale.com/ipn/ipnstate"
1919
"tailscale.com/tailcfg"
2020
"tailscale.com/util/cmpx"
@@ -181,7 +181,7 @@ func filterFormatAndSortExitNodes(peers []*ipnstate.PeerStatus, filterBy string)
181181
}
182182

183183
filteredExitNodes := filteredExitNodes{
184-
Countries: maps.Values(countries),
184+
Countries: xmaps.Values(countries),
185185
}
186186

187187
for _, country := range filteredExitNodes.Countries {

cmd/testwrapper/testwrapper.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323
"time"
2424

25-
"golang.org/x/exp/maps"
25+
xmaps "golang.org/x/exp/maps"
2626
"tailscale.com/cmd/testwrapper/flakytest"
2727
)
2828

@@ -270,7 +270,7 @@ func main() {
270270
if len(toRetry) == 0 {
271271
continue
272272
}
273-
pkgs := maps.Keys(toRetry)
273+
pkgs := xmaps.Keys(toRetry)
274274
sort.Strings(pkgs)
275275
nextRun := &nextRun{
276276
attempt: thisRun.attempt + 1,

util/osdiag/osdiag_windows_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ package osdiag
66
import (
77
"errors"
88
"fmt"
9+
"maps"
910
"strings"
1011
"testing"
1112

12-
"golang.org/x/exp/maps"
1313
"golang.org/x/sys/windows/registry"
1414
)
1515

wgengine/filter/filter_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
"github.com/google/go-cmp/cmp"
1616
"go4.org/netipx"
17-
"golang.org/x/exp/maps"
17+
xmaps "golang.org/x/exp/maps"
1818
"tailscale.com/net/packet"
1919
"tailscale.com/net/tsaddr"
2020
"tailscale.com/tailcfg"
@@ -945,7 +945,7 @@ func TestCaps(t *testing.T) {
945945
}
946946
for _, tt := range tests {
947947
t.Run(tt.name, func(t *testing.T) {
948-
got := maps.Keys(filt.CapsWithValues(netip.MustParseAddr(tt.src), netip.MustParseAddr(tt.dst)))
948+
got := xmaps.Keys(filt.CapsWithValues(netip.MustParseAddr(tt.src), netip.MustParseAddr(tt.dst)))
949949
slices.Sort(got)
950950
slices.Sort(tt.want)
951951
if !slices.Equal(got, tt.want) {

wgengine/magicsock/endpoint.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"time"
2121

2222
"golang.org/x/crypto/poly1305"
23-
"golang.org/x/exp/maps"
23+
xmaps "golang.org/x/exp/maps"
2424
"tailscale.com/disco"
2525
"tailscale.com/ipn/ipnstate"
2626
"tailscale.com/net/stun"
@@ -313,7 +313,7 @@ func (de *endpoint) addrForWireGuardSendLocked(now mono.Time) (udpAddr netip.Add
313313
return udpAddr, false
314314
}
315315

316-
candidates := maps.Keys(de.endpointState)
316+
candidates := xmaps.Keys(de.endpointState)
317317
if len(candidates) == 0 {
318318
de.c.logf("magicsock: addrForSendWireguardLocked: [unexpected] no candidates available for endpoint")
319319
return udpAddr, false

wgengine/magicsock/magicsock_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"github.com/tailscale/wireguard-go/device"
3232
"github.com/tailscale/wireguard-go/tun/tuntest"
3333
"go4.org/mem"
34-
"golang.org/x/exp/maps"
34+
xmaps "golang.org/x/exp/maps"
3535
"golang.org/x/net/icmp"
3636
"golang.org/x/net/ipv4"
3737
"golang.org/x/net/ipv6"
@@ -1081,7 +1081,7 @@ func testTwoDevicePing(t *testing.T, d *devices) {
10811081
}
10821082
}
10831083
t.Helper()
1084-
t.Errorf("missing any connection to %s from %s", wantConns, maps.Keys(stats))
1084+
t.Errorf("missing any connection to %s from %s", wantConns, xmaps.Keys(stats))
10851085
}
10861086

10871087
addrPort := netip.MustParseAddrPort

0 commit comments

Comments
 (0)