Skip to content

Commit 6ea0d2d

Browse files
authoredFeb 5, 2025
all: replace exp/maps and exp/slices with base packages (#128)
Since we wrote this code, the maps and slices packages have been promoted to mainline and expanded, so we no longer need to depend on x/exp for them.
1 parent 6b75f96 commit 6ea0d2d

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed
 

‎db/db.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ package db
1919
import (
2020
"errors"
2121
"fmt"
22+
"slices"
2223
"strings"
2324
"sync"
2425

2526
"github.com/tailscale/setec/acl"
2627
"github.com/tailscale/setec/audit"
2728
"github.com/tailscale/setec/types/api"
2829
"github.com/tink-crypto/tink-go/v2/tink"
29-
"golang.org/x/exp/slices"
3030
"tailscale.com/util/multierr"
3131
)
3232

‎db/kv.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ import (
1010
"errors"
1111
"fmt"
1212
"io/fs"
13+
"maps"
1314
"os"
14-
"sort"
15-
16-
"golang.org/x/exp/maps"
17-
"golang.org/x/exp/slices"
15+
"slices"
1816

1917
"github.com/tailscale/setec/types/api"
2018
"github.com/tink-crypto/tink-go/v2/aead"
@@ -266,9 +264,7 @@ func (kv *kv) writeGen() uint64 {
266264

267265
// list returns a list of all secret names in kv.
268266
func (kv *kv) list() []string {
269-
ret := maps.Keys(kv.secrets)
270-
sort.Strings(ret)
271-
return ret
267+
return slices.Sorted(maps.Keys(kv.secrets))
272268
}
273269

274270
// info returns metadata about a secret.

0 commit comments

Comments
 (0)