diff --git a/go.mod b/go.mod index 03c0ddb0a74b..dbb9f9601d28 100644 --- a/go.mod +++ b/go.mod @@ -55,6 +55,7 @@ require ( github.com/anchore/sqlite v1.4.6-0.20220607210448-bcc6ee5c4963 github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b github.com/in-toto/in-toto-golang v0.3.4-0.20220709202702-fa494aaa0add + github.com/mitchellh/mapstructure v1.5.0 github.com/secure-systems-lab/go-securesystemslib v0.4.0 github.com/sigstore/cosign v1.12.1 github.com/sigstore/sigstore v1.4.1 @@ -185,7 +186,6 @@ require ( github.com/miekg/pkcs11 v1.1.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect diff --git a/grype/db/v4/pkg/qualifier/from_json.go b/grype/db/v4/pkg/qualifier/from_json.go index cbe46b3b9f47..46cff3e25cb6 100644 --- a/grype/db/v4/pkg/qualifier/from_json.go +++ b/grype/db/v4/pkg/qualifier/from_json.go @@ -2,9 +2,11 @@ package qualifier import ( "encoding/json" + + "github.com/mitchellh/mapstructure" + "github.com/anchore/grype/grype/db/v4/pkg/qualifier/rpmmodularity" "github.com/anchore/grype/internal/log" - "github.com/mitchellh/mapstructure" ) func FromJSON(data []byte) ([]Qualifier, error) { diff --git a/grype/db/v4/pkg/qualifier/qualifier.go b/grype/db/v4/pkg/qualifier/qualifier.go index 284dd53836ea..d010ead8139b 100644 --- a/grype/db/v4/pkg/qualifier/qualifier.go +++ b/grype/db/v4/pkg/qualifier/qualifier.go @@ -2,6 +2,7 @@ package qualifier import ( "fmt" + "github.com/anchore/grype/grype/pkg/qualifier" ) diff --git a/grype/db/v4/pkg/qualifier/rpmmodularity/qualifier.go b/grype/db/v4/pkg/qualifier/rpmmodularity/qualifier.go index db14da5e677e..978e1060f9c4 100644 --- a/grype/db/v4/pkg/qualifier/rpmmodularity/qualifier.go +++ b/grype/db/v4/pkg/qualifier/rpmmodularity/qualifier.go @@ -2,6 +2,7 @@ package rpmmodularity import ( "fmt" + "github.com/anchore/grype/grype/pkg/qualifier" "github.com/anchore/grype/grype/pkg/qualifier/rpmmodularity" ) diff --git a/grype/db/v4/store/model/vulnerability.go b/grype/db/v4/store/model/vulnerability.go index 9a39e38eef50..7bc98d29f82e 100644 --- a/grype/db/v4/store/model/vulnerability.go +++ b/grype/db/v4/store/model/vulnerability.go @@ -3,10 +3,10 @@ package model import ( "encoding/json" "fmt" - "github.com/anchore/grype/grype/db/v4/pkg/qualifier" sqlite "github.com/anchore/grype/grype/db/internal/sqlite" v4 "github.com/anchore/grype/grype/db/v4" + "github.com/anchore/grype/grype/db/v4/pkg/qualifier" ) const ( diff --git a/grype/db/v4/store/model/vulnerability_test.go b/grype/db/v4/store/model/vulnerability_test.go index b39188ffbfdb..6e4754f8356d 100644 --- a/grype/db/v4/store/model/vulnerability_test.go +++ b/grype/db/v4/store/model/vulnerability_test.go @@ -1,12 +1,14 @@ package model import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/anchore/grype/grype/db/internal/sqlite" v4 "github.com/anchore/grype/grype/db/v4" "github.com/anchore/grype/grype/db/v4/pkg/qualifier" "github.com/anchore/grype/grype/db/v4/pkg/qualifier/rpmmodularity" - "github.com/stretchr/testify/assert" - "testing" ) func TestVulnerabilityModel_Inflate(t *testing.T) { diff --git a/grype/db/v4/vulnerability.go b/grype/db/v4/vulnerability.go index a35e886f4e63..751ae3dd17a9 100644 --- a/grype/db/v4/vulnerability.go +++ b/grype/db/v4/vulnerability.go @@ -1,9 +1,10 @@ package v4 import ( - "github.com/anchore/grype/grype/db/v4/pkg/qualifier" "sort" "strings" + + "github.com/anchore/grype/grype/db/v4/pkg/qualifier" ) // Vulnerability represents the minimum data fields necessary to perform package-to-vulnerability matching. This can represent a CVE, 3rd party advisory, or any source that relates back to a CVE. diff --git a/grype/db/vulnerability_provider_test.go b/grype/db/vulnerability_provider_test.go index c273b286a7c8..d2ba0772f41a 100644 --- a/grype/db/vulnerability_provider_test.go +++ b/grype/db/vulnerability_provider_test.go @@ -1,7 +1,6 @@ package db import ( - "github.com/anchore/grype/grype/pkg/qualifier" "testing" "github.com/go-test/deep" @@ -11,6 +10,7 @@ import ( "github.com/anchore/grype/grype/distro" "github.com/anchore/grype/grype/pkg" + "github.com/anchore/grype/grype/pkg/qualifier" "github.com/anchore/grype/grype/version" "github.com/anchore/grype/grype/vulnerability" syftPkg "github.com/anchore/syft/syft/pkg" diff --git a/grype/matcher/rpm/matcher_mocks_test.go b/grype/matcher/rpm/matcher_mocks_test.go index 4007155324e7..373f0bda0a27 100644 --- a/grype/matcher/rpm/matcher_mocks_test.go +++ b/grype/matcher/rpm/matcher_mocks_test.go @@ -1,12 +1,12 @@ package rpm import ( - "github.com/anchore/grype/grype/pkg/qualifier" - "github.com/anchore/grype/grype/pkg/qualifier/rpmmodularity" "strings" "github.com/anchore/grype/grype/distro" "github.com/anchore/grype/grype/pkg" + "github.com/anchore/grype/grype/pkg/qualifier" + "github.com/anchore/grype/grype/pkg/qualifier/rpmmodularity" "github.com/anchore/grype/grype/version" "github.com/anchore/grype/grype/vulnerability" syftPkg "github.com/anchore/syft/syft/pkg" diff --git a/grype/pkg/qualifier/rpmmodularity/qualifier.go b/grype/pkg/qualifier/rpmmodularity/qualifier.go index 6801019843fa..4f6787ecc8e2 100644 --- a/grype/pkg/qualifier/rpmmodularity/qualifier.go +++ b/grype/pkg/qualifier/rpmmodularity/qualifier.go @@ -1,9 +1,10 @@ package rpmmodularity import ( + "strings" + "github.com/anchore/grype/grype/pkg" "github.com/anchore/grype/grype/pkg/qualifier" - "strings" ) type rpmModularity struct { diff --git a/grype/pkg/qualifier/rpmmodularity/qualifier_test.go b/grype/pkg/qualifier/rpmmodularity/qualifier_test.go index 0fbc6a85ae0b..b9511b0bd1b7 100644 --- a/grype/pkg/qualifier/rpmmodularity/qualifier_test.go +++ b/grype/pkg/qualifier/rpmmodularity/qualifier_test.go @@ -1,10 +1,12 @@ package rpmmodularity import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/anchore/grype/grype/pkg" "github.com/anchore/grype/grype/pkg/qualifier" - "github.com/stretchr/testify/assert" - "testing" ) func TestRpmModularity_Satisfied(t *testing.T) { diff --git a/grype/search/only_qualified_packages.go b/grype/search/only_qualified_packages.go index 3082776afe8d..030a917b899b 100644 --- a/grype/search/only_qualified_packages.go +++ b/grype/search/only_qualified_packages.go @@ -2,8 +2,8 @@ package search import ( "fmt" - "github.com/anchore/grype/grype/pkg" + "github.com/anchore/grype/grype/pkg" "github.com/anchore/grype/grype/vulnerability" ) diff --git a/grype/vulnerability/vulnerability.go b/grype/vulnerability/vulnerability.go index b7daa5dc8930..47b43a143d7e 100644 --- a/grype/vulnerability/vulnerability.go +++ b/grype/vulnerability/vulnerability.go @@ -2,9 +2,9 @@ package vulnerability import ( "fmt" - "github.com/anchore/grype/grype/pkg/qualifier" grypeDB "github.com/anchore/grype/grype/db/v4" + "github.com/anchore/grype/grype/pkg/qualifier" "github.com/anchore/grype/grype/version" "github.com/anchore/syft/syft/pkg" )