Skip to content

Commit 1408574

Browse files
authored
remove archived dependency and use stdlib slices (#2650)
* remove archived dependency and use stdlib slices Signed-off-by: Bob Callaway <[email protected]> * fix ordering Signed-off-by: Bob Callaway <[email protected]> --------- Signed-off-by: Bob Callaway <[email protected]>
1 parent d50e846 commit 1408574

File tree

13 files changed

+15
-21
lines changed

13 files changed

+15
-21
lines changed

cmd/rekor-cli/app/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ package app
1717

1818
import (
1919
"fmt"
20+
"os"
2021
"strings"
2122

22-
homedir "github.com/mitchellh/go-homedir"
2323
"github.com/spf13/cobra"
2424
"github.com/spf13/pflag"
2525
"github.com/spf13/viper"
@@ -99,7 +99,7 @@ func initConfig(cmd *cobra.Command) error {
9999
viper.SetConfigFile(viper.GetString("config"))
100100
} else {
101101
// Find home directory.
102-
home, err := homedir.Dir()
102+
home, err := os.UserHomeDir()
103103
if err != nil {
104104
return err
105105
}

cmd/rekor-cli/app/state/state.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"os"
2222
"path/filepath"
2323

24-
"github.com/mitchellh/go-homedir"
2524
"github.com/sigstore/rekor/pkg/util"
2625
)
2726

@@ -75,7 +74,7 @@ func Load(key string) *util.SignedCheckpoint {
7574
}
7675

7776
func getRekorDir() (string, error) {
78-
home, err := homedir.Dir()
77+
home, err := os.UserHomeDir()
7978
if err != nil {
8079
return "", err
8180
}

cmd/rekor-server/app/root.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"time"
2626

2727
"github.com/go-chi/chi/v5/middleware"
28-
homedir "github.com/mitchellh/go-homedir"
2928
"github.com/sigstore/rekor/pkg/api"
3029
"github.com/sigstore/rekor/pkg/log"
3130
"github.com/sigstore/sigstore/pkg/signature"
@@ -197,7 +196,7 @@ func initConfig() {
197196
viper.SetConfigFile(cfgFile)
198197
} else {
199198
// Find home directory.
200-
home, err := homedir.Dir()
199+
home, err := os.UserHomeDir()
201200
if err != nil {
202201
fmt.Println(err)
203202
os.Exit(1)

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ require (
2020
github.com/google/trillian v1.7.2
2121
github.com/in-toto/in-toto-golang v0.9.0
2222
github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b
23-
github.com/mitchellh/go-homedir v1.1.0
23+
github.com/mitchellh/go-homedir v1.1.0 // indirect
2424
github.com/mitchellh/mapstructure v1.5.0
2525
github.com/pkg/errors v0.9.1 // indirect
2626
github.com/prometheus/client_golang v1.23.2
@@ -77,7 +77,6 @@ require (
7777
github.com/tink-crypto/tink-go-awskms/v2 v2.1.0
7878
github.com/tink-crypto/tink-go-gcpkms/v2 v2.2.0
7979
github.com/tink-crypto/tink-go/v2 v2.4.0
80-
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b
8180
google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797
8281
)
8382

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,6 @@ golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1m
570570
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
571571
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
572572
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
573-
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o=
574-
golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8=
575573
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
576574
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
577575
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=

pkg/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919
"context"
2020
"crypto/tls"
2121
"fmt"
22+
"slices"
2223

2324
"github.com/redis/go-redis/v9"
2425
"github.com/spf13/viper"
25-
"golang.org/x/exp/slices"
2626

2727
v1 "github.com/sigstore/protobuf-specs/gen/pb-go/common/v1"
2828
"github.com/sigstore/rekor/pkg/indexstorage"

pkg/events/newentry/new_entry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
package newentry
1616

1717
import (
18+
"slices"
1819
"strings"
1920
"time"
2021

2122
"github.com/sigstore/rekor/pkg/events"
22-
"golang.org/x/exp/slices"
2323

2424
rekor_pb "github.com/sigstore/protobuf-specs/gen/pb-go/rekor/v1"
2525
)

pkg/generated/restapi/configure_rekor_server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import (
4848
"github.com/sigstore/rekor/pkg/log"
4949
"github.com/sigstore/rekor/pkg/util"
5050

51-
"golang.org/x/exp/slices"
51+
"slices"
5252
)
5353

5454
//go:generate swagger generate server --target ../../generated --name RekorServer --spec ../../../openapi.yaml --principal interface{} --exclude-main

pkg/pubsub/publisher.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ package pubsub
1717
import (
1818
"context"
1919
"fmt"
20+
"maps"
21+
"slices"
2022
"strings"
2123

2224
"github.com/sigstore/rekor/pkg/events"
23-
24-
"golang.org/x/exp/maps"
25-
"golang.org/x/exp/slices"
2625
)
2726

2827
// Publisher provides methods for publishing events to a Pub/Sub topic.
@@ -68,7 +67,7 @@ func Get(ctx context.Context, topicResourceID string) (Publisher, error) {
6867

6968
// SupportedProviders returns list of initialized providers
7069
func SupportedProviders() []string {
71-
names := maps.Keys(providersMap)
70+
names := slices.Collect(maps.Keys(providersMap))
7271
slices.Sort(names)
7372
return names
7473
}

pkg/signer/signer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ package signer
1919
import (
2020
"context"
2121
"crypto"
22+
"slices"
2223
"strings"
2324
"time"
2425

2526
grpc_retry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
2627
"github.com/sigstore/sigstore/pkg/signature"
2728
"github.com/sigstore/sigstore/pkg/signature/kms"
28-
"golang.org/x/exp/slices"
2929

3030
"google.golang.org/api/option"
3131
"google.golang.org/grpc"

0 commit comments

Comments
 (0)