Skip to content

Commit

Permalink
remove dependency on golang.org/x/exp
Browse files Browse the repository at this point in the history
Some is in the stdlib now, other parts are trivial to implement without
the dep.

Signed-off-by: Mike Danese <[email protected]>
  • Loading branch information
mikedanese committed Feb 2, 2024
1 parent 9d57731 commit be2b17d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ require (
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.18.0
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
golang.org/x/sys v0.16.0
)

require (
Expand All @@ -25,6 +23,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
google.golang.org/grpc v1.56.3 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ go.opentelemetry.io/otel/trace v1.15.0 h1:5Fwje4O2ooOxkfyqI/kJwxWotggDLix4BSAvpE
go.opentelemetry.io/otel/trace v1.15.0/go.mod h1:CUsmE2Ht1CRkvE8OsMESvraoZrrcgD1J2W8GV1ev0Y4=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down
2 changes: 1 addition & 1 deletion metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ import (
"math"
"os"
"path/filepath"
"slices"
"strconv"
"strings"
"time"

"github.com/secure-systems-lab/go-securesystemslib/cjson"
"github.com/sigstore/sigstore/pkg/signature"
"golang.org/x/exp/slices"
)

// Root return new metadata instance of type Root
Expand Down
2 changes: 1 addition & 1 deletion metadata/multirepo/multirepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"fmt"
"os"
"path/filepath"
"slices"

"github.com/theupdateframework/go-tuf/v2/metadata"
"github.com/theupdateframework/go-tuf/v2/metadata/config"
"github.com/theupdateframework/go-tuf/v2/metadata/updater"
"golang.org/x/exp/slices"
)

// The following represent the map file described in TAP 4
Expand Down
8 changes: 4 additions & 4 deletions metadata/trustedmetadata/trustedmetadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/theupdateframework/go-tuf/v2/metadata"
"github.com/theupdateframework/go-tuf/v2/testutils/testutils"
"golang.org/x/exp/maps"
)

var allRoles map[string][]byte
Expand Down Expand Up @@ -634,9 +633,10 @@ func TestUpdateSnapshotSuccessfulRollbackChecks(t *testing.T) {
}

func TestUpdateTargetsMoMetaInSnapshot(t *testing.T) {

clearMeta := func(snapahot *metadata.Metadata[metadata.SnapshotType]) {
maps.Clear(snapahot.Signed.Meta)
clearMeta := func(snapshot *metadata.Metadata[metadata.SnapshotType]) {
for key := range snapshot.Signed.Meta {
delete(snapshot.Signed.Meta, key)
}
}
snapshot, err := modifySnapshotMetadata(clearMeta)
assert.NoError(t, err)
Expand Down

0 comments on commit be2b17d

Please sign in to comment.