Skip to content

Commit e8551d6

Browse files
committed
all: use Go 1.21 slices, maps instead of x/exp/{slices,maps}
Updates tailscale#8419 Signed-off-by: Brad Fitzpatrick <[email protected]>
1 parent e8d1406 commit e8551d6

File tree

47 files changed

+61
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+61
-65
lines changed

cmd/derper/depaware.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa
168168
golang.org/x/crypto/nacl/box from tailscale.com/types/key
169169
golang.org/x/crypto/nacl/secretbox from golang.org/x/crypto/nacl/box
170170
golang.org/x/crypto/salsa20/salsa from golang.org/x/crypto/nacl/box+
171-
golang.org/x/exp/constraints from golang.org/x/exp/slices
172-
golang.org/x/exp/maps from tailscale.com/types/views+
173-
golang.org/x/exp/slices from tailscale.com/net/tsaddr+
174171
L golang.org/x/net/bpf from github.com/mdlayher/netlink+
175172
golang.org/x/net/dns/dnsmessage from net+
176173
golang.org/x/net/http/httpguts from net/http
@@ -193,6 +190,7 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa
193190
golang.org/x/time/rate from tailscale.com/cmd/derper+
194191
bufio from compress/flate+
195192
bytes from bufio+
193+
cmp from slices
196194
compress/flate from compress/gzip+
197195
compress/gzip from internal/profile+
198196
container/list from crypto/tls+
@@ -242,6 +240,7 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa
242240
io/ioutil from github.com/mitchellh/go-ps+
243241
log from expvar+
244242
log/internal from log
243+
maps from tailscale.com/types/views
245244
math from compress/flate+
246245
math/big from crypto/dsa+
247246
math/bits from compress/flate+
@@ -269,6 +268,7 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa
269268
runtime/metrics from github.com/prometheus/client_golang/prometheus+
270269
runtime/pprof from net/http/pprof
271270
runtime/trace from net/http/pprof
271+
slices from tailscale.com/ipn+
272272
sort from compress/flate+
273273
strconv from compress/flate+
274274
strings from bufio+

cmd/k8s-operator/operator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
"fmt"
1313
"net/http"
1414
"os"
15+
"slices"
1516
"strings"
1617
"time"
1718

1819
"github.com/go-logr/zapr"
1920
"go.uber.org/zap"
2021
"go.uber.org/zap/zapcore"
21-
"golang.org/x/exp/slices"
2222
"golang.org/x/oauth2/clientcredentials"
2323
appsv1 "k8s.io/api/apps/v1"
2424
corev1 "k8s.io/api/core/v1"

cmd/netlogfmt/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ import (
3535
"net/http"
3636
"net/netip"
3737
"os"
38+
"slices"
3839
"strconv"
3940
"strings"
4041
"time"
4142

4243
"github.com/dsnet/try"
4344
jsonv2 "github.com/go-json-experiment/json"
44-
"golang.org/x/exp/maps"
45-
"golang.org/x/exp/slices"
4645
"tailscale.com/types/logid"
4746
"tailscale.com/types/netlogtype"
4847
"tailscale.com/util/cmpx"
@@ -315,8 +314,8 @@ func mustMakeNamesByAddr() map[netip.Addr]string {
315314
namesByAddr := make(map[netip.Addr]string)
316315
retry:
317316
for i := 0; i < 10; i++ {
318-
maps.Clear(seen)
319-
maps.Clear(namesByAddr)
317+
clear(seen)
318+
clear(namesByAddr)
320319
for _, d := range m.Devices {
321320
name := fieldPrefix(d.Name, i)
322321
if seen[name] {

cmd/tailscale/cli/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import (
1414
"log"
1515
"os"
1616
"runtime"
17+
"slices"
1718
"strings"
1819
"sync"
1920
"text/tabwriter"
2021

2122
"github.com/peterbourgon/ff/v3/ffcli"
22-
"golang.org/x/exp/slices"
2323
"tailscale.com/client/tailscale"
2424
"tailscale.com/envknob"
2525
"tailscale.com/paths"

cmd/tailscale/cli/configure-kube.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"fmt"
1212
"os"
1313
"path/filepath"
14+
"slices"
1415
"strings"
1516

1617
"github.com/peterbourgon/ff/v3/ffcli"
17-
"golang.org/x/exp/slices"
1818
"k8s.io/client-go/util/homedir"
1919
"sigs.k8s.io/yaml"
2020
"tailscale.com/version"

cmd/tailscale/cli/exitnode.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ import (
88
"errors"
99
"flag"
1010
"fmt"
11-
1211
"os"
12+
"slices"
1313
"strings"
1414
"text/tabwriter"
1515

1616
"github.com/peterbourgon/ff/v3/ffcli"
1717
"golang.org/x/exp/maps"
18-
"golang.org/x/exp/slices"
1918
"tailscale.com/ipn/ipnstate"
2019
"tailscale.com/tailcfg"
2120
"tailscale.com/util/cmpx"

cmd/tailscale/cli/funnel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"fmt"
1010
"net"
1111
"os"
12+
"slices"
1213
"strconv"
1314
"strings"
1415

1516
"github.com/peterbourgon/ff/v3/ffcli"
16-
"golang.org/x/exp/slices"
1717
"tailscale.com/ipn"
1818
"tailscale.com/ipn/ipnstate"
1919
"tailscale.com/tailcfg"

cmd/tailscale/cli/serve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import (
1818
"path/filepath"
1919
"reflect"
2020
"runtime"
21+
"slices"
2122
"sort"
2223
"strconv"
2324
"strings"
2425

2526
"github.com/peterbourgon/ff/v3/ffcli"
26-
"golang.org/x/exp/slices"
2727
"tailscale.com/client/tailscale"
2828
"tailscale.com/ipn"
2929
"tailscale.com/ipn/ipnstate"

cmd/tailscale/depaware.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,8 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
168168
golang.org/x/crypto/nacl/secretbox from golang.org/x/crypto/nacl/box
169169
golang.org/x/crypto/pbkdf2 from software.sslmate.com/src/go-pkcs12
170170
golang.org/x/crypto/salsa20/salsa from golang.org/x/crypto/nacl/box+
171-
golang.org/x/exp/constraints from golang.org/x/exp/slices+
172-
golang.org/x/exp/maps from tailscale.com/types/views+
173-
golang.org/x/exp/slices from tailscale.com/net/tsaddr+
171+
W golang.org/x/exp/constraints from github.com/dblohm7/wingoes/pe
172+
golang.org/x/exp/maps from tailscale.com/cmd/tailscale/cli
174173
golang.org/x/net/bpf from github.com/mdlayher/netlink+
175174
golang.org/x/net/dns/dnsmessage from net+
176175
golang.org/x/net/http/httpguts from net/http+
@@ -199,6 +198,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
199198
golang.org/x/time/rate from tailscale.com/cmd/tailscale/cli+
200199
bufio from compress/flate+
201200
bytes from bufio+
201+
cmp from slices
202202
compress/flate from compress/gzip+
203203
compress/gzip from net/http
204204
compress/zlib from image/png+
@@ -256,6 +256,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
256256
io/ioutil from golang.org/x/sys/cpu+
257257
log from expvar+
258258
log/internal from log
259+
maps from tailscale.com/types/views
259260
math from compress/flate+
260261
math/big from crypto/dsa+
261262
math/bits from compress/flate+
@@ -282,6 +283,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
282283
regexp from github.com/tailscale/goupnp/httpu+
283284
regexp/syntax from regexp
284285
runtime/debug from tailscale.com/util/singleflight+
286+
slices from tailscale.com/cmd/tailscale/cli+
285287
sort from compress/flate+
286288
strconv from compress/flate+
287289
strings from bufio+

cmd/tailscaled/depaware.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,8 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
379379
golang.org/x/crypto/poly1305 from github.com/tailscale/golang-x-crypto/ssh+
380380
golang.org/x/crypto/salsa20/salsa from golang.org/x/crypto/nacl/box+
381381
LD golang.org/x/crypto/ssh from tailscale.com/ssh/tailssh+
382-
golang.org/x/exp/constraints from golang.org/x/exp/slices+
383-
golang.org/x/exp/maps from tailscale.com/wgengine+
384-
golang.org/x/exp/slices from tailscale.com/ipn/ipnlocal+
382+
golang.org/x/exp/constraints from github.com/dblohm7/wingoes/pe+
383+
golang.org/x/exp/maps from tailscale.com/wgengine/magicsock
385384
golang.org/x/net/bpf from github.com/mdlayher/genetlink+
386385
golang.org/x/net/dns/dnsmessage from net+
387386
golang.org/x/net/http/httpguts from golang.org/x/net/http2+
@@ -467,6 +466,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
467466
log from expvar+
468467
log/internal from log
469468
LD log/syslog from tailscale.com/ssh/tailssh
469+
maps from tailscale.com/types/views
470470
math from compress/flate+
471471
math/big from crypto/dsa+
472472
math/bits from compress/flate+
@@ -496,7 +496,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
496496
runtime/debug from github.com/klauspost/compress/zstd+
497497
runtime/pprof from net/http/pprof+
498498
runtime/trace from net/http/pprof
499-
slices from tailscale.com/wgengine/magicsock
499+
slices from tailscale.com/wgengine/magicsock+
500500
sort from compress/flate+
501501
strconv from compress/flate+
502502
strings from bufio+

0 commit comments

Comments
 (0)