From 8d284b3ab086ee5e35ce513e369855ad29884256 Mon Sep 17 00:00:00 2001 From: coops Date: Thu, 18 Nov 2021 11:18:19 +1000 Subject: [PATCH 1/2] golang: update to v1.17, remove deprecated -f option and update tests --- deplist_test.go | 62 ++++++++++--------- go.mod | 8 ++- go.sum | 2 +- internal/scan/golang.go | 4 +- vendor/github.com/BurntSushi/toml/go.mod | 3 - vendor/github.com/BurntSushi/toml/go.sum | 0 vendor/github.com/mcoops/jargo/go.mod | 5 -- vendor/github.com/mcoops/jargo/go.sum | 8 --- vendor/github.com/mcoops/packageurl-go/go.mod | 3 - vendor/github.com/sirupsen/logrus/go.mod | 10 --- vendor/github.com/sirupsen/logrus/go.sum | 8 --- vendor/github.com/vifraa/gopom/go.mod | 5 -- vendor/github.com/vifraa/gopom/go.sum | 12 ---- vendor/gopkg.in/yaml.v3/go.mod | 5 -- vendor/modules.txt | 13 ++-- 15 files changed, 48 insertions(+), 100 deletions(-) delete mode 100644 vendor/github.com/BurntSushi/toml/go.mod delete mode 100644 vendor/github.com/BurntSushi/toml/go.sum delete mode 100644 vendor/github.com/mcoops/jargo/go.mod delete mode 100644 vendor/github.com/mcoops/jargo/go.sum delete mode 100644 vendor/github.com/mcoops/packageurl-go/go.mod delete mode 100644 vendor/github.com/sirupsen/logrus/go.mod delete mode 100644 vendor/github.com/sirupsen/logrus/go.sum delete mode 100644 vendor/github.com/vifraa/gopom/go.mod delete mode 100644 vendor/github.com/vifraa/gopom/go.sum delete mode 100644 vendor/gopkg.in/yaml.v3/go.mod diff --git a/deplist_test.go b/deplist_test.go index be40397..ab32da3 100644 --- a/deplist_test.go +++ b/deplist_test.go @@ -8,42 +8,45 @@ func BuildWant() []Dependency { var deps []Dependency golangPaths := []string{ - "internal/cpu", - "unsafe", - "internal/bytealg", - "runtime/internal/atomic", - "runtime/internal/sys", - "runtime/internal/math", - "runtime", - "internal/reflectlite", "errors", - "math/bits", - "math", - "unicode/utf8", - "strconv", - "internal/race", - "sync/atomic", - "sync", - "unicode", - "reflect", - "sort", + "fmt", + "github.com/mcoops/deplist", + "github.com/openshift/api/config/v1", + "golang.org/x/text/unicode", + "internal/abi", + "internal/bytealg", + "internal/cpu", "internal/fmtsort", - "io", + "internal/goexperiment", + "internal/itoa", "internal/oserror", - "syscall", - "time", "internal/poll", + "internal/race", + "internal/reflectlite", "internal/syscall/execenv", "internal/syscall/unix", "internal/testlog", + "internal/unsafeheader", + "io", + "io/fs", + "math", + "math/bits", "os", - "fmt", "path", - "io/fs", - "internal/unsafeheader", - "github.com/openshift/api/config/v1", - "golang.org/x/text/unicode", - "github.com/mcoops/deplist", + "reflect", + "runtime", + "runtime/internal/atomic", + "runtime/internal/math", + "runtime/internal/sys", + "sort", + "strconv", + "sync", + "sync/atomic", + "syscall", + "time", + "unicode", + "unicode/utf8", + "unsafe", } npmSet1 := []string{ @@ -203,8 +206,7 @@ func BuildWant() []Dependency { deps = append(deps, d) } - end := len(deps) - 2 // get the unicode ver - deps[end].Version = "v0.3.3" + deps[4].Version = "v0.3.3" // test golang.org/x/text/unicode version for _, n := range npmSet1 { d := Dependency{ @@ -231,7 +233,7 @@ func BuildWant() []Dependency { deps = append(deps, d) } - end = len(deps) - 2 // get the cryptography ver + end := len(deps) - 2 // get the cryptography ver deps[end].Version = "0.5.1" end = len(deps) - 1 // get the cryptography ver diff --git a/go.mod b/go.mod index 0eb890f..601d480 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mcoops/deplist -go 1.16 +go 1.17 require ( github.com/BurntSushi/toml v0.4.1 @@ -8,6 +8,10 @@ require ( github.com/mcoops/packageurl-go v0.2.0 github.com/sirupsen/logrus v1.8.1 golang.org/x/mod v0.4.2 - golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) + +require ( + github.com/vifraa/gopom v0.1.0 // indirect + golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect +) diff --git a/go.sum b/go.sum index ec70f7c..033adf3 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/scan/golang.go b/internal/scan/golang.go index 4b099fd..42e52d9 100644 --- a/internal/scan/golang.go +++ b/internal/scan/golang.go @@ -55,7 +55,7 @@ func runCmd(path string, mod bool) ([]byte, error) { var cmd *exec.Cmd if !mod { - cmd = exec.CommandContext(ctx, "go", "list", "-f", "'{{if not .Standard}}{{.Module}}{{end}}'", "-json", "-deps", "./...") + cmd = exec.CommandContext(ctx, "go", "list", "-json", "-deps", "./...") } else { vendorDir := filepath.Join(filepath.Dir(path), "vendor") if _, err := os.Stat(vendorDir); err != nil { @@ -63,7 +63,7 @@ func runCmd(path string, mod bool) ([]byte, error) { return nil, errors.New("no 'vendor' directory, can't use '-mod=vendor'") } } - cmd = exec.CommandContext(ctx, "go", "list", "-mod=vendor", "-f", "'{{if not .Standard}}{{.Module}}{{end}}'", "-json", "-deps", "./...") + cmd = exec.CommandContext(ctx, "go", "list", "-mod=vendor", "-json", "-deps", "./...") } cmd.Dir = filepath.Dir(path) // // force directory diff --git a/vendor/github.com/BurntSushi/toml/go.mod b/vendor/github.com/BurntSushi/toml/go.mod deleted file mode 100644 index 8298948..0000000 --- a/vendor/github.com/BurntSushi/toml/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/BurntSushi/toml - -go 1.16 diff --git a/vendor/github.com/BurntSushi/toml/go.sum b/vendor/github.com/BurntSushi/toml/go.sum deleted file mode 100644 index e69de29..0000000 diff --git a/vendor/github.com/mcoops/jargo/go.mod b/vendor/github.com/mcoops/jargo/go.mod deleted file mode 100644 index 706b136..0000000 --- a/vendor/github.com/mcoops/jargo/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/mcoops/jargo - -go 1.16 - -require github.com/vifraa/gopom v0.1.0 // indirect diff --git a/vendor/github.com/mcoops/jargo/go.sum b/vendor/github.com/mcoops/jargo/go.sum deleted file mode 100644 index 47cf7d6..0000000 --- a/vendor/github.com/mcoops/jargo/go.sum +++ /dev/null @@ -1,8 +0,0 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/vifraa/gopom v0.1.0 h1:v897eVxf6lflkEXzPmKbo4YhX2oS/LGjz7cqjWnSmCU= -github.com/vifraa/gopom v0.1.0/go.mod h1:oPa1dcrGrtlO37WPDBm5SqHAT+wTgF8An1Q71Z6Vv4o= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/github.com/mcoops/packageurl-go/go.mod b/vendor/github.com/mcoops/packageurl-go/go.mod deleted file mode 100644 index 0c7355c..0000000 --- a/vendor/github.com/mcoops/packageurl-go/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/mcoops/packageurl-go - -go 1.16 diff --git a/vendor/github.com/sirupsen/logrus/go.mod b/vendor/github.com/sirupsen/logrus/go.mod deleted file mode 100644 index b3919d5..0000000 --- a/vendor/github.com/sirupsen/logrus/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/sirupsen/logrus - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.2.2 - golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 -) - -go 1.13 diff --git a/vendor/github.com/sirupsen/logrus/go.sum b/vendor/github.com/sirupsen/logrus/go.sum deleted file mode 100644 index 694c18b..0000000 --- a/vendor/github.com/sirupsen/logrus/go.sum +++ /dev/null @@ -1,8 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/vifraa/gopom/go.mod b/vendor/github.com/vifraa/gopom/go.mod deleted file mode 100644 index 7ae72ad..0000000 --- a/vendor/github.com/vifraa/gopom/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module github.com/vifraa/gopom - -go 1.15 - -require github.com/stretchr/testify v1.6.1 diff --git a/vendor/github.com/vifraa/gopom/go.sum b/vendor/github.com/vifraa/gopom/go.sum deleted file mode 100644 index 1f1e7af..0000000 --- a/vendor/github.com/vifraa/gopom/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/vendor/gopkg.in/yaml.v3/go.mod b/vendor/gopkg.in/yaml.v3/go.mod deleted file mode 100644 index f407ea3..0000000 --- a/vendor/gopkg.in/yaml.v3/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module "gopkg.in/yaml.v3" - -require ( - "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 -) diff --git a/vendor/modules.txt b/vendor/modules.txt index 5409987..3bbf85c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,23 +1,24 @@ # github.com/BurntSushi/toml v0.4.1 -## explicit +## explicit; go 1.16 github.com/BurntSushi/toml github.com/BurntSushi/toml/internal # github.com/mcoops/jargo v1.0.1 -## explicit +## explicit; go 1.16 github.com/mcoops/jargo # github.com/mcoops/packageurl-go v0.2.0 -## explicit +## explicit; go 1.16 github.com/mcoops/packageurl-go # github.com/sirupsen/logrus v1.8.1 -## explicit +## explicit; go 1.13 github.com/sirupsen/logrus # github.com/vifraa/gopom v0.1.0 +## explicit; go 1.15 github.com/vifraa/gopom # golang.org/x/mod v0.4.2 -## explicit +## explicit; go 1.12 golang.org/x/mod/semver # golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e -## explicit +## explicit; go 1.17 golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix golang.org/x/sys/windows From 139ece45139e14b91ba45f4c737d4012881ec744 Mon Sep 17 00:00:00 2001 From: coops Date: Thu, 18 Nov 2021 11:19:15 +1000 Subject: [PATCH 2/2] gh_actions: use go 1.17 --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a8e3cae..aaeb41c 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - run: bundle config --local path $PWD/vendor/bundle - name: Set up Node