mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-31 05:23:14 +00:00
all: import x/exp/maps as xmaps to distinguish from Go 1.21 "maps"
Updates #8419 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
e8551d6b40
commit
bc0eb6b914
@ -14,7 +14,7 @@ import (
|
|||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
|
|
||||||
"github.com/peterbourgon/ff/v3/ffcli"
|
"github.com/peterbourgon/ff/v3/ffcli"
|
||||||
"golang.org/x/exp/maps"
|
xmaps "golang.org/x/exp/maps"
|
||||||
"tailscale.com/ipn/ipnstate"
|
"tailscale.com/ipn/ipnstate"
|
||||||
"tailscale.com/tailcfg"
|
"tailscale.com/tailcfg"
|
||||||
"tailscale.com/util/cmpx"
|
"tailscale.com/util/cmpx"
|
||||||
@ -181,7 +181,7 @@ func filterFormatAndSortExitNodes(peers []*ipnstate.PeerStatus, filterBy string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
filteredExitNodes := filteredExitNodes{
|
filteredExitNodes := filteredExitNodes{
|
||||||
Countries: maps.Values(countries),
|
Countries: xmaps.Values(countries),
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, country := range filteredExitNodes.Countries {
|
for _, country := range filteredExitNodes.Countries {
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/exp/maps"
|
xmaps "golang.org/x/exp/maps"
|
||||||
"tailscale.com/cmd/testwrapper/flakytest"
|
"tailscale.com/cmd/testwrapper/flakytest"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ func main() {
|
|||||||
if len(toRetry) == 0 {
|
if len(toRetry) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
pkgs := maps.Keys(toRetry)
|
pkgs := xmaps.Keys(toRetry)
|
||||||
sort.Strings(pkgs)
|
sort.Strings(pkgs)
|
||||||
nextRun := &nextRun{
|
nextRun := &nextRun{
|
||||||
attempt: thisRun.attempt + 1,
|
attempt: thisRun.attempt + 1,
|
||||||
|
@ -6,10 +6,10 @@ package osdiag
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"golang.org/x/exp/maps"
|
|
||||||
"golang.org/x/sys/windows/registry"
|
"golang.org/x/sys/windows/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
"go4.org/netipx"
|
"go4.org/netipx"
|
||||||
"golang.org/x/exp/maps"
|
xmaps "golang.org/x/exp/maps"
|
||||||
"tailscale.com/net/packet"
|
"tailscale.com/net/packet"
|
||||||
"tailscale.com/net/tsaddr"
|
"tailscale.com/net/tsaddr"
|
||||||
"tailscale.com/tailcfg"
|
"tailscale.com/tailcfg"
|
||||||
@ -945,7 +945,7 @@ func TestCaps(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
got := maps.Keys(filt.CapsWithValues(netip.MustParseAddr(tt.src), netip.MustParseAddr(tt.dst)))
|
got := xmaps.Keys(filt.CapsWithValues(netip.MustParseAddr(tt.src), netip.MustParseAddr(tt.dst)))
|
||||||
slices.Sort(got)
|
slices.Sort(got)
|
||||||
slices.Sort(tt.want)
|
slices.Sort(tt.want)
|
||||||
if !slices.Equal(got, tt.want) {
|
if !slices.Equal(got, tt.want) {
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/crypto/poly1305"
|
"golang.org/x/crypto/poly1305"
|
||||||
"golang.org/x/exp/maps"
|
xmaps "golang.org/x/exp/maps"
|
||||||
"tailscale.com/disco"
|
"tailscale.com/disco"
|
||||||
"tailscale.com/ipn/ipnstate"
|
"tailscale.com/ipn/ipnstate"
|
||||||
"tailscale.com/net/stun"
|
"tailscale.com/net/stun"
|
||||||
@ -313,7 +313,7 @@ func (de *endpoint) addrForWireGuardSendLocked(now mono.Time) (udpAddr netip.Add
|
|||||||
return udpAddr, false
|
return udpAddr, false
|
||||||
}
|
}
|
||||||
|
|
||||||
candidates := maps.Keys(de.endpointState)
|
candidates := xmaps.Keys(de.endpointState)
|
||||||
if len(candidates) == 0 {
|
if len(candidates) == 0 {
|
||||||
de.c.logf("magicsock: addrForSendWireguardLocked: [unexpected] no candidates available for endpoint")
|
de.c.logf("magicsock: addrForSendWireguardLocked: [unexpected] no candidates available for endpoint")
|
||||||
return udpAddr, false
|
return udpAddr, false
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
"github.com/tailscale/wireguard-go/device"
|
"github.com/tailscale/wireguard-go/device"
|
||||||
"github.com/tailscale/wireguard-go/tun/tuntest"
|
"github.com/tailscale/wireguard-go/tun/tuntest"
|
||||||
"go4.org/mem"
|
"go4.org/mem"
|
||||||
"golang.org/x/exp/maps"
|
xmaps "golang.org/x/exp/maps"
|
||||||
"golang.org/x/net/icmp"
|
"golang.org/x/net/icmp"
|
||||||
"golang.org/x/net/ipv4"
|
"golang.org/x/net/ipv4"
|
||||||
"golang.org/x/net/ipv6"
|
"golang.org/x/net/ipv6"
|
||||||
@ -1081,7 +1081,7 @@ func testTwoDevicePing(t *testing.T, d *devices) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
t.Helper()
|
t.Helper()
|
||||||
t.Errorf("missing any connection to %s from %s", wantConns, maps.Keys(stats))
|
t.Errorf("missing any connection to %s from %s", wantConns, xmaps.Keys(stats))
|
||||||
}
|
}
|
||||||
|
|
||||||
addrPort := netip.MustParseAddrPort
|
addrPort := netip.MustParseAddrPort
|
||||||
|
Loading…
x
Reference in New Issue
Block a user