diff --git a/pkg/fanal/analyzer/analyzer_test.go b/pkg/fanal/analyzer/analyzer_test.go index 43aa52c6c186..d64e5f5e767e 100644 --- a/pkg/fanal/analyzer/analyzer_test.go +++ b/pkg/fanal/analyzer/analyzer_test.go @@ -338,7 +338,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) { ID: "musl@1.1.24-r2", Name: "musl", Version: "1.1.24-r2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl@1.1.24-r2", }, SrcName: "musl", @@ -382,7 +382,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) { ID: "actioncable@5.2.3", Name: "actioncable", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actioncable@5.2.3", }, Indirect: false, @@ -400,7 +400,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) { ID: "actionpack@5.2.3", Name: "actionpack", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actionpack@5.2.3", }, Indirect: true, @@ -449,7 +449,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) { ID: "actioncable@5.2.3", Name: "actioncable", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actioncable@5.2.3", }, Indirect: false, @@ -467,7 +467,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) { ID: "actionpack@5.2.3", Name: "actionpack", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actionpack@5.2.3", }, Indirect: true, @@ -587,7 +587,7 @@ func TestAnalyzerGroup_PostAnalyze(t *testing.T) { { Name: "com.fasterxml.jackson.core:jackson-annotations", Version: "2.15.0-rc2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-annotations@2.15.0-rc2", }, FilePath: "testdata/post-apps/jar/jackson-annotations-2.15.0-rc2.jar", @@ -611,7 +611,7 @@ func TestAnalyzerGroup_PostAnalyze(t *testing.T) { ID: "certifi@2022.12.7", Name: "certifi", Version: "2022.12.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/certifi@2022.12.7", }, }, diff --git a/pkg/fanal/analyzer/language/analyze_test.go b/pkg/fanal/analyzer/language/analyze_test.go index a8ff178776e8..db6c11ebcef8 100644 --- a/pkg/fanal/analyzer/language/analyze_test.go +++ b/pkg/fanal/analyzer/language/analyze_test.go @@ -67,7 +67,7 @@ func TestAnalyze(t *testing.T) { { Name: "test", Version: "1.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/test@1.2.3", }, }, diff --git a/pkg/fanal/analyzer/language/c/conan/conan_test.go b/pkg/fanal/analyzer/language/c/conan/conan_test.go index 77a85c1ad62b..8e11ae9cf3c4 100644 --- a/pkg/fanal/analyzer/language/c/conan/conan_test.go +++ b/pkg/fanal/analyzer/language/c/conan/conan_test.go @@ -32,7 +32,7 @@ func Test_conanLockAnalyzer_Analyze(t *testing.T) { ID: "openssl/3.0.5", Name: "openssl", Version: "3.0.5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:conan/openssl@3.0.5", }, DependsOn: []string{ @@ -49,7 +49,7 @@ func Test_conanLockAnalyzer_Analyze(t *testing.T) { ID: "zlib/1.2.12", Name: "zlib", Version: "1.2.12", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:conan/zlib@1.2.12", }, Indirect: true, diff --git a/pkg/fanal/analyzer/language/conda/meta/meta_test.go b/pkg/fanal/analyzer/language/conda/meta/meta_test.go index 998820415c70..01a8e899515c 100644 --- a/pkg/fanal/analyzer/language/conda/meta/meta_test.go +++ b/pkg/fanal/analyzer/language/conda/meta/meta_test.go @@ -31,7 +31,7 @@ func Test_packagingAnalyzer_Analyze(t *testing.T) { { Name: "pip", Version: "22.2.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:conda/pip@22.2.2", }, Licenses: []string{"MIT"}, diff --git a/pkg/fanal/analyzer/language/dart/pub/pubspec_test.go b/pkg/fanal/analyzer/language/dart/pub/pubspec_test.go index d0286eca11dc..2081530874e5 100644 --- a/pkg/fanal/analyzer/language/dart/pub/pubspec_test.go +++ b/pkg/fanal/analyzer/language/dart/pub/pubspec_test.go @@ -37,7 +37,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "collection@1.17.0", Name: "collection", Version: "1.17.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/collection@1.17.0", }, Indirect: true, @@ -46,7 +46,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "crypto@3.0.3", Name: "crypto", Version: "3.0.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/crypto@3.0.3", }, DependsOn: []string{ @@ -57,7 +57,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "meta@1.11.0", Name: "meta", Version: "1.11.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/meta@1.11.0", }, }, @@ -65,7 +65,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "typed_data@1.3.2", Name: "typed_data", Version: "1.3.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/typed_data@1.3.2", }, Indirect: true, @@ -93,7 +93,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "collection@1.17.0", Name: "collection", Version: "1.17.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/collection@1.17.0", }, Indirect: true, @@ -102,7 +102,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "crypto@3.0.3", Name: "crypto", Version: "3.0.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/crypto@3.0.3", }, }, @@ -110,7 +110,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "meta@1.11.0", Name: "meta", Version: "1.11.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/meta@1.11.0", }, }, @@ -118,7 +118,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) { ID: "typed_data@1.3.2", Name: "typed_data", Version: "1.3.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dart/typed_data@1.3.2", }, Indirect: true, diff --git a/pkg/fanal/analyzer/language/dotnet/deps/deps_test.go b/pkg/fanal/analyzer/language/dotnet/deps/deps_test.go index 58eb20c42b44..f470b9efdcbd 100644 --- a/pkg/fanal/analyzer/language/dotnet/deps/deps_test.go +++ b/pkg/fanal/analyzer/language/dotnet/deps/deps_test.go @@ -31,7 +31,7 @@ func Test_depsLibraryAnalyzer_Analyze(t *testing.T) { { Name: "Newtonsoft.Json", Version: "9.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/Newtonsoft.Json@9.0.1", }, Locations: []types.Location{ diff --git a/pkg/fanal/analyzer/language/dotnet/nuget/nuget_test.go b/pkg/fanal/analyzer/language/dotnet/nuget/nuget_test.go index 19e297a2cd42..55e4c83010d9 100644 --- a/pkg/fanal/analyzer/language/dotnet/nuget/nuget_test.go +++ b/pkg/fanal/analyzer/language/dotnet/nuget/nuget_test.go @@ -34,14 +34,14 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) { { Name: "Microsoft.AspNet.WebApi", Version: "5.2.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/Microsoft.AspNet.WebApi@5.2.2", }, }, { Name: "Newtonsoft.Json", Version: "6.0.4", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/Newtonsoft.Json@6.0.4", }, }, @@ -66,7 +66,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) { ID: "Newtonsoft.Json@12.0.3", Name: "Newtonsoft.Json", Version: "12.0.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/Newtonsoft.Json@12.0.3", }, Locations: []types.Location{ @@ -81,7 +81,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) { ID: "NuGet.Frameworks@5.7.0", Name: "NuGet.Frameworks", Version: "5.7.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/NuGet.Frameworks@5.7.0", }, Locations: []types.Location{ @@ -113,7 +113,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) { ID: "Newtonsoft.Json@12.0.3", Name: "Newtonsoft.Json", Version: "12.0.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/Newtonsoft.Json@12.0.3", }, Locations: []types.Location{ @@ -128,7 +128,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) { ID: "NuGet.Frameworks@5.7.0", Name: "NuGet.Frameworks", Version: "5.7.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/NuGet.Frameworks@5.7.0", }, Locations: []types.Location{ @@ -160,7 +160,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) { ID: "Newtonsoft.Json@12.0.3", Name: "Newtonsoft.Json", Version: "12.0.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/Newtonsoft.Json@12.0.3", }, Locations: []types.Location{ @@ -174,7 +174,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) { ID: "NuGet.Frameworks@5.7.0", Name: "NuGet.Frameworks", Version: "5.7.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:nuget/NuGet.Frameworks@5.7.0", }, Locations: []types.Location{ diff --git a/pkg/fanal/analyzer/language/elixir/mix/mix_test.go b/pkg/fanal/analyzer/language/elixir/mix/mix_test.go index cba87e59d17e..80a5b7d00f25 100644 --- a/pkg/fanal/analyzer/language/elixir/mix/mix_test.go +++ b/pkg/fanal/analyzer/language/elixir/mix/mix_test.go @@ -30,7 +30,7 @@ func Test_mixLockAnalyzer_Analyze(t *testing.T) { ID: "bunt@0.2.0", Name: "bunt", Version: "0.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:hex/bunt@0.2.0", }, Locations: []types.Location{ diff --git a/pkg/fanal/analyzer/language/golang/binary/binary_test.go b/pkg/fanal/analyzer/language/golang/binary/binary_test.go index b4223000f55f..41242ec04ca7 100644 --- a/pkg/fanal/analyzer/language/golang/binary/binary_test.go +++ b/pkg/fanal/analyzer/language/golang/binary/binary_test.go @@ -32,21 +32,21 @@ func Test_gobinaryLibraryAnalyzer_Analyze(t *testing.T) { { Name: "github.com/aquasecurity/go-pep440-version", Version: "v0.0.0-20210121094942-22b2f8951d46", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/go-pep440-version@v0.0.0-20210121094942-22b2f8951d46", }, }, { Name: "github.com/aquasecurity/go-version", Version: "v0.0.0-20210121072130-637058cfe492", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/go-version@v0.0.0-20210121072130-637058cfe492", }, }, { Name: "golang.org/x/xerrors", Version: "v0.0.0-20200804184101-5ec99f83aff1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1", }, }, diff --git a/pkg/fanal/analyzer/language/golang/mod/mod_test.go b/pkg/fanal/analyzer/language/golang/mod/mod_test.go index a26c65f22012..5e8a2d0361b5 100644 --- a/pkg/fanal/analyzer/language/golang/mod/mod_test.go +++ b/pkg/fanal/analyzer/language/golang/mod/mod_test.go @@ -36,7 +36,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { ID: "github.com/aquasecurity/go-dep-parser@v0.0.0-20220406074731-71021a481237", Name: "github.com/aquasecurity/go-dep-parser", Version: "0.0.0-20220406074731-71021a481237", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/go-dep-parser@0.0.0-20220406074731-71021a481237", }, Licenses: []string{ @@ -50,7 +50,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { ID: "golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1", Name: "golang.org/x/xerrors", Version: "0.0.0-20200804184101-5ec99f83aff1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/golang.org/x/xerrors@0.0.0-20200804184101-5ec99f83aff1", }, Indirect: true, @@ -75,7 +75,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { ID: "github.com/sad/sad@v0.0.1", Name: "github.com/sad/sad", Version: "0.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/sad/sad@0.0.1", }, }, @@ -100,7 +100,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { ID: "github.com/aquasecurity/go-dep-parser@v0.0.0-20230219131432-590b1dfb6edd", Name: "github.com/aquasecurity/go-dep-parser", Version: "0.0.0-20230219131432-590b1dfb6edd", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/go-dep-parser@0.0.0-20230219131432-590b1dfb6edd", }, DependsOn: []string{ @@ -111,7 +111,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { ID: "github.com/BurntSushi/toml@v0.3.1", Name: "github.com/BurntSushi/toml", Version: "0.3.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/burntsushi/toml@0.3.1", }, Indirect: true, @@ -139,7 +139,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { ID: "github.com/aquasecurity/go-dep-parser@v0.0.0-20230219131432-590b1dfb6edd", Name: "github.com/aquasecurity/go-dep-parser", Version: "0.0.0-20230219131432-590b1dfb6edd", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/go-dep-parser@0.0.0-20230219131432-590b1dfb6edd", }, DependsOn: []string{}, diff --git a/pkg/fanal/analyzer/language/java/gradle/lockfile_test.go b/pkg/fanal/analyzer/language/java/gradle/lockfile_test.go index 392c9757c4d2..a78907352e25 100644 --- a/pkg/fanal/analyzer/language/java/gradle/lockfile_test.go +++ b/pkg/fanal/analyzer/language/java/gradle/lockfile_test.go @@ -29,7 +29,7 @@ func Test_gradleLockAnalyzer_Analyze(t *testing.T) { { Name: "com.example:example", Version: "0.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.example/example@0.0.1", }, }, diff --git a/pkg/fanal/analyzer/language/java/jar/jar_test.go b/pkg/fanal/analyzer/language/java/jar/jar_test.go index 730dcd406a70..a06300c9f986 100644 --- a/pkg/fanal/analyzer/language/java/jar/jar_test.go +++ b/pkg/fanal/analyzer/language/java/jar/jar_test.go @@ -40,7 +40,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "org.glassfish:javax.el", FilePath: "testdata/test.war/WEB-INF/lib/javax.el-3.0.0.jar", Version: "3.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/org.glassfish/javax.el@3.0.0", }, }, @@ -48,7 +48,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "com.fasterxml.jackson.core:jackson-databind", FilePath: "testdata/test.war/WEB-INF/lib/jackson-databind-2.9.10.6.jar", Version: "2.9.10.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.9.10.6", }, }, @@ -56,7 +56,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "com.fasterxml.jackson.core:jackson-annotations", FilePath: "testdata/test.war/WEB-INF/lib/jackson-annotations-2.9.10.jar", Version: "2.9.10", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-annotations@2.9.10", }, }, @@ -64,7 +64,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "com.fasterxml.jackson.core:jackson-core", FilePath: "testdata/test.war/WEB-INF/lib/jackson-core-2.9.10.jar", Version: "2.9.10", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-core@2.9.10", }, }, @@ -72,7 +72,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "org.slf4j:slf4j-api", FilePath: "testdata/test.war/WEB-INF/lib/slf4j-api-1.7.30.jar", Version: "1.7.30", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/org.slf4j/slf4j-api@1.7.30", }, }, @@ -80,7 +80,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "com.cronutils:cron-utils", FilePath: "testdata/test.war/WEB-INF/lib/cron-utils-9.1.2.jar", Version: "9.1.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.cronutils/cron-utils@9.1.2", }, }, @@ -88,7 +88,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "org.apache.commons:commons-lang3", FilePath: "testdata/test.war/WEB-INF/lib/commons-lang3-3.11.jar", Version: "3.11", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/org.apache.commons/commons-lang3@3.11", }, }, @@ -96,7 +96,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "com.example:web-app", FilePath: "testdata/test.war", Version: "1.0-SNAPSHOT", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.example/web-app@1.0-SNAPSHOT", }, }, @@ -119,7 +119,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "com.fasterxml.jackson.core:jackson-core", FilePath: "testdata/test.par/lib/jackson-core-2.9.10.jar", Version: "2.9.10", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-core@2.9.10", }, Digest: "sha1:d40913470259cfba6dcc90f96bcaa9bcff1b72e0", @@ -142,7 +142,7 @@ func Test_javaLibraryAnalyzer_Analyze(t *testing.T) { Name: "org.apache.tomcat.embed:tomcat-embed-websocket", FilePath: "testdata/test.jar", Version: "9.0.65", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/org.apache.tomcat.embed/tomcat-embed-websocket@9.0.65", }, }, diff --git a/pkg/fanal/analyzer/language/java/pom/pom_test.go b/pkg/fanal/analyzer/language/java/pom/pom_test.go index c3bc93c8be16..f63459d28ce8 100644 --- a/pkg/fanal/analyzer/language/java/pom/pom_test.go +++ b/pkg/fanal/analyzer/language/java/pom/pom_test.go @@ -33,7 +33,7 @@ func Test_pomAnalyzer_Analyze(t *testing.T) { ID: "com.example:example:1.0.0", Name: "com.example:example", Version: "1.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.example/example@1.0.0", }, Licenses: []string{"Apache-2.0"}, @@ -57,7 +57,7 @@ func Test_pomAnalyzer_Analyze(t *testing.T) { ID: "com.example:example:1.0.0", Name: "com.example:example", Version: "1.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.example/example@1.0.0", }, Licenses: []string{"Apache-2.0"}, @@ -80,7 +80,7 @@ func Test_pomAnalyzer_Analyze(t *testing.T) { ID: "com.example:example:2.0.0", Name: "com.example:example", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/com.example/example@2.0.0", }, Licenses: []string{"Apache-2.0"}, diff --git a/pkg/fanal/analyzer/language/nodejs/npm/npm_test.go b/pkg/fanal/analyzer/language/nodejs/npm/npm_test.go index 85f6a6c7c66a..d76c1d0889f0 100644 --- a/pkg/fanal/analyzer/language/nodejs/npm/npm_test.go +++ b/pkg/fanal/analyzer/language/nodejs/npm/npm_test.go @@ -38,7 +38,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "ansi-colors@3.2.3", Name: "ansi-colors", Version: "3.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/ansi-colors@3.2.3", }, Dev: true, @@ -54,7 +54,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "array-flatten@1.1.1", Name: "array-flatten", Version: "1.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/array-flatten@1.1.1", }, Indirect: true, @@ -69,7 +69,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "body-parser@1.18.3", Name: "body-parser", Version: "1.18.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/body-parser@1.18.3", }, Indirect: true, @@ -86,7 +86,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "debug@2.6.9", Name: "debug", Version: "2.6.9", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/debug@2.6.9", }, Indirect: true, @@ -107,7 +107,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "express@4.16.4", Name: "express", Version: "4.16.4", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/express@4.16.4", }, Indirect: true, @@ -124,7 +124,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "ms@2.0.0", Name: "ms", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/ms@2.0.0", }, Indirect: true, @@ -144,7 +144,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "ms@2.1.1", Name: "ms", Version: "2.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/ms@2.1.1", }, Indirect: true, @@ -174,7 +174,7 @@ func Test_npmLibraryAnalyzer_Analyze(t *testing.T) { ID: "ms@2.1.1", Name: "ms", Version: "2.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/ms@2.1.1", }, Indirect: true, diff --git a/pkg/fanal/analyzer/language/nodejs/pkg/pkg_test.go b/pkg/fanal/analyzer/language/nodejs/pkg/pkg_test.go index 16049b2c63f9..43ea368f78db 100644 --- a/pkg/fanal/analyzer/language/nodejs/pkg/pkg_test.go +++ b/pkg/fanal/analyzer/language/nodejs/pkg/pkg_test.go @@ -33,7 +33,7 @@ func Test_nodePkgLibraryAnalyzer_Analyze(t *testing.T) { ID: "lodash@5.0.0", Name: "lodash", Version: "5.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/lodash@5.0.0", }, Licenses: []string{"MIT"}, @@ -58,7 +58,7 @@ func Test_nodePkgLibraryAnalyzer_Analyze(t *testing.T) { ID: "lodash@5.0.0", Name: "lodash", Version: "5.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/lodash@5.0.0", }, Licenses: []string{"MIT"}, diff --git a/pkg/fanal/analyzer/language/nodejs/pnpm/pnpm_test.go b/pkg/fanal/analyzer/language/nodejs/pnpm/pnpm_test.go index 7866d5be2f0c..3d6cd8783832 100644 --- a/pkg/fanal/analyzer/language/nodejs/pnpm/pnpm_test.go +++ b/pkg/fanal/analyzer/language/nodejs/pnpm/pnpm_test.go @@ -32,7 +32,7 @@ func Test_pnpmPkgLibraryAnalyzer_Analyze(t *testing.T) { ID: "lodash@4.17.21", Name: "lodash", Version: "4.17.21", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/lodash@4.17.21", }, }, diff --git a/pkg/fanal/analyzer/language/nodejs/yarn/yarn_test.go b/pkg/fanal/analyzer/language/nodejs/yarn/yarn_test.go index 36b128e2b67f..f08a2b340ccf 100644 --- a/pkg/fanal/analyzer/language/nodejs/yarn/yarn_test.go +++ b/pkg/fanal/analyzer/language/nodejs/yarn/yarn_test.go @@ -31,7 +31,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "js-tokens@2.0.0", Name: "js-tokens", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/js-tokens@2.0.0", }, Locations: []types.Location{ @@ -45,7 +45,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "js-tokens@4.0.0", Name: "js-tokens", Version: "4.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/js-tokens@4.0.0", }, Indirect: true, @@ -60,7 +60,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "loose-envify@1.4.0", Name: "loose-envify", Version: "1.4.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/loose-envify@1.4.0", }, Indirect: true, @@ -78,7 +78,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "object-assign@4.1.1", Name: "object-assign", Version: "4.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/object-assign@4.1.1", }, Indirect: true, @@ -93,7 +93,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "prop-types@15.7.2", Name: "prop-types", Version: "15.7.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/prop-types@15.7.2", }, Dev: true, @@ -113,7 +113,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "react-is@16.13.1", Name: "react-is", Version: "16.13.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/react-is@16.13.1", }, Dev: true, @@ -129,7 +129,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "scheduler@0.13.6", Name: "scheduler", Version: "0.13.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/scheduler@0.13.6", }, Locations: []types.Location{ @@ -161,7 +161,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "js-tokens@2.0.0", Name: "js-tokens", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/js-tokens@2.0.0", }, Locations: []types.Location{ @@ -175,7 +175,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "js-tokens@4.0.0", Name: "js-tokens", Version: "4.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/js-tokens@4.0.0", }, Locations: []types.Location{ @@ -189,7 +189,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "loose-envify@1.4.0", Name: "loose-envify", Version: "1.4.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/loose-envify@1.4.0", }, Locations: []types.Location{ @@ -206,7 +206,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "object-assign@4.1.1", Name: "object-assign", Version: "4.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/object-assign@4.1.1", }, Locations: []types.Location{ @@ -220,7 +220,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "prop-types@15.7.2", Name: "prop-types", Version: "15.7.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/prop-types@15.7.2", }, Locations: []types.Location{ @@ -239,7 +239,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "react-is@16.13.1", Name: "react-is", Version: "16.13.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/react-is@16.13.1", }, Locations: []types.Location{ @@ -253,7 +253,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "scheduler@0.13.6", Name: "scheduler", Version: "0.13.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/scheduler@0.13.6", }, Locations: []types.Location{ @@ -285,7 +285,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "js-tokens@2.0.0", Name: "js-tokens", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/js-tokens@2.0.0", }, Locations: []types.Location{ @@ -324,7 +324,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "is-callable@1.2.7", Name: "is-callable", Version: "1.2.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/is-callable@1.2.7", }, Licenses: []string{"MIT"}, @@ -339,7 +339,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "is-number@6.0.0", Name: "is-number", Version: "6.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/is-number@6.0.0", }, Licenses: []string{"MIT"}, @@ -355,7 +355,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "is-odd@3.0.1", Name: "is-odd", Version: "3.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/is-odd@3.0.1", }, Licenses: []string{"MIT"}, @@ -385,7 +385,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "is-number@6.0.0", Name: "is-number", Version: "6.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/is-number@6.0.0", }, Indirect: true, @@ -400,7 +400,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "is-number@7.0.0", Name: "is-number", Version: "7.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/is-number@7.0.0", }, Locations: []types.Location{ @@ -414,7 +414,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "is-odd@3.0.1", Name: "is-odd", Version: "3.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/is-odd@3.0.1", }, DependsOn: []string{"is-number@6.0.0"}, @@ -429,7 +429,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "js-tokens@4.0.0", Name: "js-tokens", Version: "4.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/js-tokens@4.0.0", }, Indirect: true, @@ -444,7 +444,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "js-tokens@8.0.1", Name: "js-tokens", Version: "8.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/js-tokens@8.0.1", }, Locations: []types.Location{ @@ -458,7 +458,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "loose-envify@1.4.0", Name: "loose-envify", Version: "1.4.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/loose-envify@1.4.0", }, Indirect: true, @@ -474,7 +474,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "object-assign@4.1.1", Name: "object-assign", Version: "4.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/object-assign@4.1.1", }, Indirect: true, @@ -490,7 +490,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "prettier@2.8.8", Name: "prettier", Version: "2.8.8", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/prettier@2.8.8", }, Dev: true, @@ -505,7 +505,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "prop-types@15.8.1", Name: "prop-types", Version: "15.8.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/prop-types@15.8.1", }, Dev: true, @@ -525,7 +525,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "react-is@16.13.1", Name: "react-is", Version: "16.13.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/react-is@16.13.1", }, Dev: true, @@ -541,7 +541,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "scheduler@0.23.0", Name: "scheduler", Version: "0.23.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/scheduler@0.23.0", }, DependsOn: []string{"loose-envify@1.4.0"}, @@ -574,7 +574,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "@babel/parser@7.22.7", Name: "@babel/parser", Version: "7.22.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/%40babel/parser@7.22.7", }, Indirect: true, @@ -590,7 +590,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "@vue/compiler-sfc@2.7.14", Name: "@vue/compiler-sfc", Version: "2.7.14", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/%40vue/compiler-sfc@2.7.14", }, Indirect: false, @@ -611,7 +611,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "nanoid@3.3.6", Name: "nanoid", Version: "3.3.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/nanoid@3.3.6", }, Indirect: true, @@ -627,7 +627,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "picocolors@1.0.0", Name: "picocolors", Version: "1.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/picocolors@1.0.0", }, Indirect: true, @@ -643,7 +643,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "postcss@8.4.27", Name: "postcss", Version: "8.4.27", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/postcss@8.4.27", }, Indirect: true, @@ -664,7 +664,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "source-map@0.6.1", Name: "source-map", Version: "0.6.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/source-map@0.6.1", }, Indirect: true, @@ -680,7 +680,7 @@ func Test_yarnLibraryAnalyzer_Analyze(t *testing.T) { ID: "source-map-js@1.0.2", Name: "source-map-js", Version: "1.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/source-map-js@1.0.2", }, Indirect: true, diff --git a/pkg/fanal/analyzer/language/php/composer/composer_test.go b/pkg/fanal/analyzer/language/php/composer/composer_test.go index c9715130940e..f110ff9601e3 100644 --- a/pkg/fanal/analyzer/language/php/composer/composer_test.go +++ b/pkg/fanal/analyzer/language/php/composer/composer_test.go @@ -31,7 +31,7 @@ func Test_composerAnalyzer_PostAnalyze(t *testing.T) { ID: "pear/log@1.13.3", Name: "pear/log", Version: "1.13.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.3", }, Indirect: false, @@ -48,7 +48,7 @@ func Test_composerAnalyzer_PostAnalyze(t *testing.T) { ID: "pear/pear_exception@v1.0.2", Name: "pear/pear_exception", Version: "v1.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.2", }, Indirect: true, @@ -78,7 +78,7 @@ func Test_composerAnalyzer_PostAnalyze(t *testing.T) { ID: "pear/log@1.13.3", Name: "pear/log", Version: "1.13.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.3", }, Indirect: false, @@ -95,7 +95,7 @@ func Test_composerAnalyzer_PostAnalyze(t *testing.T) { ID: "pear/pear_exception@v1.0.2", Name: "pear/pear_exception", Version: "v1.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.2", }, Indirect: false, @@ -125,7 +125,7 @@ func Test_composerAnalyzer_PostAnalyze(t *testing.T) { ID: "pear/log@1.13.3", Name: "pear/log", Version: "1.13.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.3", }, Indirect: false, @@ -142,7 +142,7 @@ func Test_composerAnalyzer_PostAnalyze(t *testing.T) { ID: "pear/pear_exception@v1.0.2", Name: "pear/pear_exception", Version: "v1.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.2", }, Indirect: false, diff --git a/pkg/fanal/analyzer/language/python/packaging/packaging_test.go b/pkg/fanal/analyzer/language/python/packaging/packaging_test.go index 5d7e742c6c45..012e4f9e8b1b 100644 --- a/pkg/fanal/analyzer/language/python/packaging/packaging_test.go +++ b/pkg/fanal/analyzer/language/python/packaging/packaging_test.go @@ -32,7 +32,7 @@ func Test_packagingAnalyzer_Analyze(t *testing.T) { { Name: "kitchen", Version: "1.2.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/kitchen@1.2.6", }, Licenses: []string{"LGPLv2+"}, @@ -56,7 +56,7 @@ func Test_packagingAnalyzer_Analyze(t *testing.T) { { Name: "distlib", Version: "0.3.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/distlib@0.3.1", }, Licenses: []string{"Python license"}, @@ -80,7 +80,7 @@ func Test_packagingAnalyzer_Analyze(t *testing.T) { { Name: "setuptools", Version: "51.3.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/setuptools@51.3.3", }, Licenses: []string{"MIT License"}, @@ -103,7 +103,7 @@ func Test_packagingAnalyzer_Analyze(t *testing.T) { { Name: "setuptools", Version: "51.3.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/setuptools@51.3.3", }, Licenses: []string{"MIT License"}, @@ -126,7 +126,7 @@ func Test_packagingAnalyzer_Analyze(t *testing.T) { { Name: "distlib", Version: "0.3.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/distlib@0.3.1", }, Licenses: []string{"Python license"}, diff --git a/pkg/fanal/analyzer/language/python/pip/pip_test.go b/pkg/fanal/analyzer/language/python/pip/pip_test.go index 056045a6b595..9fe1c2d91dd9 100644 --- a/pkg/fanal/analyzer/language/python/pip/pip_test.go +++ b/pkg/fanal/analyzer/language/python/pip/pip_test.go @@ -31,21 +31,21 @@ func Test_pipAnalyzer_Analyze(t *testing.T) { { Name: "click", Version: "8.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/click@8.0.0", }, }, { Name: "Flask", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/flask@2.0.0", }, }, { Name: "itsdangerous", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/itsdangerous@2.0.0", }, }, diff --git a/pkg/fanal/analyzer/language/python/poetry/poetry_test.go b/pkg/fanal/analyzer/language/python/poetry/poetry_test.go index 0d82a0432da1..7e7a368af52b 100644 --- a/pkg/fanal/analyzer/language/python/poetry/poetry_test.go +++ b/pkg/fanal/analyzer/language/python/poetry/poetry_test.go @@ -31,7 +31,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "certifi@2022.12.7", Name: "certifi", Version: "2022.12.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/certifi@2022.12.7", }, Indirect: true, @@ -40,7 +40,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "charset-normalizer@2.1.1", Name: "charset-normalizer", Version: "2.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/charset-normalizer@2.1.1", }, Indirect: true, @@ -49,7 +49,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "click@7.1.2", Name: "click", Version: "7.1.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/click@7.1.2", }, Indirect: true, @@ -58,7 +58,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "flask@1.1.4", Name: "flask", Version: "1.1.4", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/flask@1.1.4", }, DependsOn: []string{ @@ -72,7 +72,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "idna@3.4", Name: "idna", Version: "3.4", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/idna@3.4", }, Indirect: true, @@ -81,7 +81,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "itsdangerous@1.1.0", Name: "itsdangerous", Version: "1.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/itsdangerous@1.1.0", }, Indirect: true, @@ -90,7 +90,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "jinja2@2.11.3", Name: "jinja2", Version: "2.11.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/jinja2@2.11.3", }, Indirect: true, @@ -102,7 +102,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "markupsafe@2.1.2", Name: "markupsafe", Version: "2.1.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/markupsafe@2.1.2", }, Indirect: true, @@ -111,7 +111,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "requests@2.28.1", Name: "requests", Version: "2.28.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/requests@2.28.1", }, DependsOn: []string{ @@ -125,7 +125,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "urllib3@1.26.14", Name: "urllib3", Version: "1.26.14", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/urllib3@1.26.14", }, Indirect: true, @@ -134,7 +134,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "werkzeug@1.0.1", Name: "werkzeug", Version: "1.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/werkzeug@1.0.1", }, Indirect: true, @@ -157,7 +157,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "click@8.1.3", Name: "click", Version: "8.1.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/click@8.1.3", }, DependsOn: []string{ @@ -168,7 +168,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "colorama@0.4.6", Name: "colorama", Version: "0.4.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/colorama@0.4.6", }, }, @@ -190,7 +190,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "click@8.1.3", Name: "click", Version: "8.1.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/click@8.1.3", }, DependsOn: []string{ @@ -201,7 +201,7 @@ func Test_poetryLibraryAnalyzer_Analyze(t *testing.T) { ID: "colorama@0.4.6", Name: "colorama", Version: "0.4.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/colorama@0.4.6", }, }, diff --git a/pkg/fanal/analyzer/language/ruby/gemspec/gemspec_test.go b/pkg/fanal/analyzer/language/ruby/gemspec/gemspec_test.go index 612cb85011da..550d1de8eb44 100644 --- a/pkg/fanal/analyzer/language/ruby/gemspec/gemspec_test.go +++ b/pkg/fanal/analyzer/language/ruby/gemspec/gemspec_test.go @@ -32,7 +32,7 @@ func Test_gemspecLibraryAnalyzer_Analyze(t *testing.T) { { Name: "test-unit", Version: "3.3.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/test-unit@3.3.7", }, Licenses: []string{ @@ -60,7 +60,7 @@ func Test_gemspecLibraryAnalyzer_Analyze(t *testing.T) { { Name: "test-unit", Version: "3.3.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/test-unit@3.3.7", }, Licenses: []string{ diff --git a/pkg/fanal/analyzer/language/rust/binary/binary_test.go b/pkg/fanal/analyzer/language/rust/binary/binary_test.go index 2e81d08e4cbb..8dcaa32e7d35 100644 --- a/pkg/fanal/analyzer/language/rust/binary/binary_test.go +++ b/pkg/fanal/analyzer/language/rust/binary/binary_test.go @@ -33,7 +33,7 @@ func Test_rustBinaryLibraryAnalyzer_Analyze(t *testing.T) { ID: "crate_with_features@0.1.0", Name: "crate_with_features", Version: "0.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/crate_with_features@0.1.0", }, DependsOn: []string{"library_crate@0.1.0"}, @@ -42,7 +42,7 @@ func Test_rustBinaryLibraryAnalyzer_Analyze(t *testing.T) { ID: "library_crate@0.1.0", Name: "library_crate", Version: "0.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/library_crate@0.1.0", }, Indirect: true, diff --git a/pkg/fanal/analyzer/language/rust/cargo/cargo_test.go b/pkg/fanal/analyzer/language/rust/cargo/cargo_test.go index 1367cc4b69d6..696b3897c8f1 100644 --- a/pkg/fanal/analyzer/language/rust/cargo/cargo_test.go +++ b/pkg/fanal/analyzer/language/rust/cargo/cargo_test.go @@ -32,7 +32,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "aho-corasick@0.7.20", Name: "aho-corasick", Version: "0.7.20", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/aho-corasick@0.7.20", }, Indirect: true, @@ -48,7 +48,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "libc@0.2.140", Name: "libc", Version: "0.2.140", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/libc@0.2.140", }, Indirect: true, @@ -63,7 +63,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "memchr@1.0.2", Name: "memchr", Version: "1.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/memchr@1.0.2", }, Indirect: false, @@ -79,7 +79,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "memchr@2.5.0", Name: "memchr", Version: "2.5.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/memchr@2.5.0", }, Indirect: true, @@ -94,7 +94,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "regex@1.7.3", Name: "regex", Version: "1.7.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/regex@1.7.3", }, Indirect: false, @@ -114,7 +114,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "regex-syntax@0.5.6", Name: "regex-syntax", Version: "0.5.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/regex-syntax@0.5.6", }, Indirect: false, @@ -130,7 +130,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "regex-syntax@0.6.29", Name: "regex-syntax", Version: "0.6.29", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/regex-syntax@0.6.29", }, Indirect: true, @@ -145,7 +145,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "ucd-util@0.1.10", Name: "ucd-util", Version: "0.1.10", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/ucd-util@0.1.10", }, Indirect: true, @@ -174,7 +174,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "memchr@2.5.0", Name: "memchr", Version: "2.5.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/memchr@2.5.0", }, Indirect: false, @@ -203,7 +203,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "aho-corasick@0.7.20", Name: "aho-corasick", Version: "0.7.20", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/aho-corasick@0.7.20", }, Indirect: false, @@ -219,7 +219,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "app@0.1.0", Name: "app", Version: "0.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/app@0.1.0", }, Indirect: false, @@ -239,7 +239,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "libc@0.2.140", Name: "libc", Version: "0.2.140", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/libc@0.2.140", }, Indirect: false, @@ -254,7 +254,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "memchr@1.0.2", Name: "memchr", Version: "1.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/memchr@1.0.2", }, Indirect: false, @@ -270,7 +270,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "memchr@2.5.0", Name: "memchr", Version: "2.5.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/memchr@2.5.0", }, Indirect: false, @@ -285,7 +285,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "regex@1.7.3", Name: "regex", Version: "1.7.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/regex@1.7.3", }, Indirect: false, @@ -305,7 +305,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "regex-syntax@0.5.6", Name: "regex-syntax", Version: "0.5.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/regex-syntax@0.5.6", }, Indirect: false, @@ -321,7 +321,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "regex-syntax@0.6.29", Name: "regex-syntax", Version: "0.6.29", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/regex-syntax@0.6.29", }, Indirect: false, @@ -336,7 +336,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "ucd-util@0.1.10", Name: "ucd-util", Version: "0.1.10", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/ucd-util@0.1.10", }, Indirect: false, @@ -351,7 +351,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "winapi@0.3.9", Name: "winapi", Version: "0.3.9", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/winapi@0.3.9", }, Indirect: false, @@ -370,7 +370,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "winapi-i686-pc-windows-gnu@0.4.0", Name: "winapi-i686-pc-windows-gnu", Version: "0.4.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/winapi-i686-pc-windows-gnu@0.4.0", }, Indirect: false, @@ -385,7 +385,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "winapi-x86_64-pc-windows-gnu@0.4.0", Name: "winapi-x86_64-pc-windows-gnu", Version: "0.4.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/winapi-x86_64-pc-windows-gnu@0.4.0", }, Indirect: false, @@ -414,7 +414,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "app@0.1.0", Name: "app", Version: "0.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/app@0.1.0", }, Indirect: false, @@ -430,7 +430,7 @@ func Test_cargoAnalyzer_Analyze(t *testing.T) { ID: "memchr@2.5.0", Name: "memchr", Version: "2.5.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cargo/memchr@2.5.0", }, Indirect: false, diff --git a/pkg/fanal/analyzer/language/swift/cocoapods/cocoapods_test.go b/pkg/fanal/analyzer/language/swift/cocoapods/cocoapods_test.go index 52977ea17a54..6a7137ac6615 100644 --- a/pkg/fanal/analyzer/language/swift/cocoapods/cocoapods_test.go +++ b/pkg/fanal/analyzer/language/swift/cocoapods/cocoapods_test.go @@ -31,7 +31,7 @@ func Test_cocoaPodsLockAnalyzer_Analyze(t *testing.T) { ID: "AppCenter@4.2.0", Name: "AppCenter", Version: "4.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cocoapods/AppCenter@4.2.0", }, DependsOn: []string{ @@ -43,7 +43,7 @@ func Test_cocoaPodsLockAnalyzer_Analyze(t *testing.T) { ID: "AppCenter/Analytics@4.2.0", Name: "AppCenter/Analytics", Version: "4.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cocoapods/AppCenter@4.2.0#Analytics", }, DependsOn: []string{ @@ -54,7 +54,7 @@ func Test_cocoaPodsLockAnalyzer_Analyze(t *testing.T) { ID: "AppCenter/Core@4.2.0", Name: "AppCenter/Core", Version: "4.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cocoapods/AppCenter@4.2.0#Core", }, }, @@ -62,7 +62,7 @@ func Test_cocoaPodsLockAnalyzer_Analyze(t *testing.T) { ID: "AppCenter/Crashes@4.2.0", Name: "AppCenter/Crashes", Version: "4.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cocoapods/AppCenter@4.2.0#Crashes", }, DependsOn: []string{ @@ -73,7 +73,7 @@ func Test_cocoaPodsLockAnalyzer_Analyze(t *testing.T) { ID: "KeychainAccess@4.2.1", Name: "KeychainAccess", Version: "4.2.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:cocoapods/KeychainAccess@4.2.1", }, }, diff --git a/pkg/fanal/analyzer/language/swift/swift/swift_test.go b/pkg/fanal/analyzer/language/swift/swift/swift_test.go index 22364db178a5..b1fc741589a0 100644 --- a/pkg/fanal/analyzer/language/swift/swift/swift_test.go +++ b/pkg/fanal/analyzer/language/swift/swift/swift_test.go @@ -31,7 +31,7 @@ func Test_swiftLockAnalyzer_Analyze(t *testing.T) { ID: "github.com/Quick/Nimble@9.2.1", Name: "github.com/Quick/Nimble", Version: "9.2.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:swift/github.com/Quick/Nimble@9.2.1", }, Locations: []types.Location{ @@ -45,7 +45,7 @@ func Test_swiftLockAnalyzer_Analyze(t *testing.T) { ID: "github.com/Quick/Quick@7.0.0", Name: "github.com/Quick/Quick", Version: "7.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:swift/github.com/Quick/Quick@7.0.0", }, Locations: []types.Location{ @@ -59,7 +59,7 @@ func Test_swiftLockAnalyzer_Analyze(t *testing.T) { ID: "github.com/ReactiveCocoa/ReactiveSwift@7.1.1", Name: "github.com/ReactiveCocoa/ReactiveSwift", Version: "7.1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:swift/github.com/ReactiveCocoa/ReactiveSwift@7.1.1", }, Locations: []types.Location{ diff --git a/pkg/fanal/analyzer/pkg/apk/apk_test.go b/pkg/fanal/analyzer/pkg/apk/apk_test.go index 0356ec866981..928ab0e33164 100644 --- a/pkg/fanal/analyzer/pkg/apk/apk_test.go +++ b/pkg/fanal/analyzer/pkg/apk/apk_test.go @@ -15,7 +15,7 @@ var pkgs = []types.Package{ { ID: "musl@1.1.14-r10", Name: "musl", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl@1.1.14-r10", }, Version: "1.1.14-r10", @@ -32,7 +32,7 @@ var pkgs = []types.Package{ { ID: "busybox@1.24.2-r9", Name: "busybox", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/busybox@1.24.2-r9", }, Version: "1.24.2-r9", @@ -53,7 +53,7 @@ var pkgs = []types.Package{ { ID: "alpine-baselayout@3.0.3-r0", Name: "alpine-baselayout", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/alpine-baselayout@3.0.3-r0", }, Version: "3.0.3-r0", @@ -94,7 +94,7 @@ var pkgs = []types.Package{ { ID: "alpine-keys@1.1-r0", Name: "alpine-keys", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/alpine-keys@1.1-r0", }, Version: "1.1-r0", @@ -114,7 +114,7 @@ var pkgs = []types.Package{ { ID: "zlib@1.2.8-r2", Name: "zlib", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/zlib@1.2.8-r2", }, Version: "1.2.8-r2", @@ -132,7 +132,7 @@ var pkgs = []types.Package{ { ID: "libcrypto1.0@1.0.2h-r1", Name: "libcrypto1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/libcrypto1.0@1.0.2h-r1", }, Version: "1.0.2h-r1", @@ -163,7 +163,7 @@ var pkgs = []types.Package{ { ID: "libssl1.0@1.0.2h-r1", Name: "libssl1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/libssl1.0@1.0.2h-r1", }, Version: "1.0.2h-r1", @@ -184,7 +184,7 @@ var pkgs = []types.Package{ { ID: "apk-tools@2.6.7-r0", Name: "apk-tools", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/apk-tools@2.6.7-r0", }, Version: "2.6.7-r0", @@ -206,7 +206,7 @@ var pkgs = []types.Package{ { ID: "scanelf@1.1.6-r0", Name: "scanelf", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/scanelf@1.1.6-r0", }, Version: "1.1.6-r0", @@ -223,7 +223,7 @@ var pkgs = []types.Package{ { ID: "musl-utils@1.1.14-r10", Name: "musl-utils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl-utils@1.1.14-r10", }, Version: "1.1.14-r10", @@ -247,7 +247,7 @@ var pkgs = []types.Package{ { ID: "libc-utils@0.7-r0", Name: "libc-utils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/libc-utils@0.7-r0", }, Version: "0.7-r0", @@ -262,7 +262,7 @@ var pkgs = []types.Package{ { ID: "pkgconf@1.6.0-r0", Name: "pkgconf", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/pkgconf@1.6.0-r0", }, Version: "1.6.0-r0", @@ -284,7 +284,7 @@ var pkgs = []types.Package{ { ID: "sqlite-libs@3.26.0-r3", Name: "sqlite-libs", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/sqlite-libs@3.26.0-r3", }, Version: "3.26.0-r3", @@ -303,7 +303,7 @@ var pkgs = []types.Package{ { ID: "test@2.9.11_pre20061021-r2", Name: "test", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/test@2.9.11_pre20061021-r2", }, Version: "2.9.11_pre20061021-r2", diff --git a/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go b/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go index 8f0a127bca05..94841cd7f455 100644 --- a/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go +++ b/pkg/fanal/analyzer/pkg/dpkg/dpkg_test.go @@ -34,7 +34,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "adduser@3.116ubuntu1", Name: "adduser", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/adduser@3.116ubuntu1", }, Version: "3.116ubuntu1", @@ -50,7 +50,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "apt@1.6.3ubuntu0.1", Name: "apt", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/apt@1.6.3ubuntu0.1", }, Version: "1.6.3ubuntu0.1", @@ -73,7 +73,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "base-files@10.1ubuntu2.2", Name: "base-files", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/base-files@10.1ubuntu2.2", }, Version: "10.1ubuntu2.2", @@ -85,7 +85,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "base-passwd@3.5.44", Name: "base-passwd", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/base-passwd@3.5.44", }, Version: "3.5.44", @@ -101,7 +101,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "bash@4.4.18-2ubuntu1", Name: "bash", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/bash@4.4.18-2ubuntu1", }, Version: "4.4.18", @@ -119,7 +119,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "bsdutils@1:2.31.1-0.4ubuntu3.1", Name: "bsdutils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/bsdutils@1%3A2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -134,7 +134,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "bzip2@1.0.6-8.1", Name: "bzip2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/bzip2@1.0.6-8.1", }, Version: "1.0.6", @@ -152,7 +152,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "coreutils@8.28-1ubuntu1", Name: "coreutils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/coreutils@8.28-1ubuntu1", }, Version: "8.28", @@ -166,7 +166,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "dash@0.5.8-2.10", Name: "dash", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/dash@0.5.8-2.10", }, Version: "0.5.8", @@ -184,7 +184,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "debconf@1.5.66", Name: "debconf", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/debconf@1.5.66", }, Version: "1.5.66", @@ -196,7 +196,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "debianutils@4.8.4", Name: "debianutils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/debianutils@4.8.4", }, Version: "4.8.4", @@ -208,7 +208,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "diffutils@1:3.6-1", Name: "diffutils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/diffutils@1%3A3.6-1", }, Epoch: 1, @@ -224,7 +224,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "dpkg@1.19.0.5ubuntu2", Name: "dpkg", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/dpkg@1.19.0.5ubuntu2", }, Version: "1.19.0.5ubuntu2", @@ -239,7 +239,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "e2fsprogs@1.44.1-1", Name: "e2fsprogs", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/e2fsprogs@1.44.1-1", }, Version: "1.44.1", @@ -253,7 +253,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "fdisk@2.31.1-0.4ubuntu3.1", Name: "fdisk", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/fdisk@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -275,7 +275,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "findutils@4.6.0+git+20170828-2", Name: "findutils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/findutils@4.6.0%2Bgit%2B20170828-2", }, Version: "4.6.0+git+20170828", @@ -289,7 +289,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "gcc-8-base@8-20180414-1ubuntu2", Name: "gcc-8-base", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/gcc-8-base@8-20180414-1ubuntu2", }, Version: "8-20180414", @@ -303,7 +303,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "gpgv@2.2.4-1ubuntu1.1", Name: "gpgv", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/gpgv@2.2.4-1ubuntu1.1", }, Version: "2.2.4", @@ -324,7 +324,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "grep@3.1-2", Name: "grep", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/grep@3.1-2", }, Version: "3.1", @@ -341,7 +341,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "gzip@1.6-5ubuntu1", Name: "gzip", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/gzip@1.6-5ubuntu1", }, Version: "1.6", @@ -358,7 +358,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "hostname@3.20", Name: "hostname", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/hostname@3.20", }, Version: "3.20", @@ -370,7 +370,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "init-system-helpers@1.51", Name: "init-system-helpers", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/init-system-helpers@1.51", }, Version: "1.51", @@ -385,7 +385,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libacl1@2.2.52-3build1", Name: "libacl1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libacl1@2.2.52-3build1", }, Version: "2.2.52", @@ -403,7 +403,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libapt-pkg5.0@1.6.3ubuntu0.1", Name: "libapt-pkg5.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libapt-pkg5.0@1.6.3ubuntu0.1", }, Version: "1.6.3ubuntu0.1", @@ -426,7 +426,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libattr1@1:2.4.47-2build1", Name: "libattr1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libattr1@1%3A2.4.47-2build1", }, Epoch: 1, @@ -445,7 +445,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libaudit-common@1:2.8.2-1ubuntu1", Name: "libaudit-common", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libaudit-common@1%3A2.8.2-1ubuntu1", }, Version: "2.8.2", @@ -461,7 +461,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libaudit1@1:2.8.2-1ubuntu1", Name: "libaudit1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libaudit1@1%3A2.8.2-1ubuntu1", }, Epoch: 1, @@ -482,7 +482,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libblkid1@2.31.1-0.4ubuntu3.1", Name: "libblkid1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libblkid1@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -500,7 +500,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libbz2-1.0@1.0.6-8.1", Name: "libbz2-1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libbz2-1.0@1.0.6-8.1", }, Version: "1.0.6", @@ -517,7 +517,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libc-bin@2.27-3ubuntu1", Name: "libc-bin", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libc-bin@2.27-3ubuntu1", }, Version: "2.27", @@ -534,7 +534,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libc6@2.27-3ubuntu1", Name: "libc6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libc6@2.27-3ubuntu1", }, Version: "2.27", @@ -551,7 +551,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libcap-ng0@0.7.7-3.1", Name: "libcap-ng0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libcap-ng0@0.7.7-3.1", }, Version: "0.7.7", @@ -568,7 +568,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libcom-err2@1.44.1-1", Name: "libcom-err2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libcom-err2@1.44.1-1", }, Version: "1.44.1", @@ -585,7 +585,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libdb5.3@5.3.28-13.1ubuntu1", Name: "libdb5.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libdb5.3@5.3.28-13.1ubuntu1", }, Version: "5.3.28", @@ -602,7 +602,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libdebconfclient0@0.213ubuntu1", Name: "libdebconfclient0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libdebconfclient0@0.213ubuntu1", }, Version: "0.213ubuntu1", @@ -617,7 +617,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libext2fs2@1.44.1-1", Name: "libext2fs2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libext2fs2@1.44.1-1", }, Version: "1.44.1", @@ -634,7 +634,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libfdisk1@2.31.1-0.4ubuntu3.1", Name: "libfdisk1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libfdisk1@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -653,7 +653,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libffi6@3.2.1-8", Name: "libffi6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libffi6@3.2.1-8", }, Version: "3.2.1", @@ -670,7 +670,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libgcc1@1:8-20180414-1ubuntu2", Name: "libgcc1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libgcc1@1%3A8-20180414-1ubuntu2", }, Epoch: 1, @@ -689,7 +689,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libgcrypt20@1.8.1-4ubuntu1.1", Name: "libgcrypt20", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libgcrypt20@1.8.1-4ubuntu1.1", }, Version: "1.8.1", @@ -707,7 +707,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libgmp10@2:6.1.2+dfsg-2", Name: "libgmp10", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libgmp10@2%3A6.1.2%2Bdfsg-2", }, Epoch: 2, @@ -726,7 +726,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libgnutls30@3.5.18-1ubuntu1", Name: "libgnutls30", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libgnutls30@3.5.18-1ubuntu1", }, Version: "3.5.18", @@ -751,7 +751,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libgpg-error0@1.27-6", Name: "libgpg-error0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libgpg-error0@1.27-6", }, Version: "1.27", @@ -768,7 +768,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libhogweed4@3.4-1", Name: "libhogweed4", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libhogweed4@3.4-1", }, Version: "3.4", @@ -787,7 +787,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libidn2-0@2.0.4-1.1build2", Name: "libidn2-0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libidn2-0@2.0.4-1.1build2", }, Version: "2.0.4", @@ -805,7 +805,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "liblz4-1@0.0~r131-2ubuntu3", Name: "liblz4-1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/liblz4-1@0.0~r131-2ubuntu3", }, Version: "0.0~r131", @@ -822,7 +822,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "liblzma5@5.1.1alpha+20120614-2+b3", Name: "liblzma5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/liblzma5@5.1.1alpha%2B20120614-2%2Bb3", }, Version: "5.1.1alpha+20120614", @@ -839,7 +839,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libmount1@2.31.1-0.4ubuntu3.1", Name: "libmount1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libmount1@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -858,7 +858,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libncurses5@6.1-1ubuntu1.18.04", Name: "libncurses5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libncurses5@6.1-1ubuntu1.18.04", }, Version: "6.1", @@ -876,7 +876,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libncursesw5@6.1-1ubuntu1.18.04", Name: "libncursesw5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libncursesw5@6.1-1ubuntu1.18.04", }, Version: "6.1", @@ -894,7 +894,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libnettle6@3.4-1", Name: "libnettle6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libnettle6@3.4-1", }, Version: "3.4", @@ -911,7 +911,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libp11-kit0@0.23.9-2", Name: "libp11-kit0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libp11-kit0@0.23.9-2", }, Version: "0.23.9", @@ -929,7 +929,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libpam-modules@1.1.8-3.6ubuntu2", Name: "libpam-modules", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libpam-modules@1.1.8-3.6ubuntu2", }, Version: "1.1.8", @@ -943,7 +943,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libpam-modules-bin@1.1.8-3.6ubuntu2", Name: "libpam-modules-bin", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libpam-modules-bin@1.1.8-3.6ubuntu2", }, Version: "1.1.8", @@ -963,7 +963,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libpam-runtime@1.1.8-3.6ubuntu2", Name: "libpam-runtime", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libpam-runtime@1.1.8-3.6ubuntu2", }, Version: "1.1.8", @@ -981,7 +981,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libpam0g@1.1.8-3.6ubuntu2", Name: "libpam0g", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libpam0g@1.1.8-3.6ubuntu2", }, Version: "1.1.8", @@ -1000,7 +1000,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libpcre3@2:8.39-9", Name: "libpcre3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libpcre3@2%3A8.39-9", }, Version: "8.39", @@ -1019,7 +1019,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libprocps6@2:3.3.12-3ubuntu1.1", Name: "libprocps6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libprocps6@2%3A3.3.12-3ubuntu1.1", }, Version: "3.3.12", @@ -1039,7 +1039,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libseccomp2@2.3.1-2.1ubuntu4", Name: "libseccomp2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libseccomp2@2.3.1-2.1ubuntu4", }, Version: "2.3.1", @@ -1056,7 +1056,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libselinux1@2.7-2build2", Name: "libselinux1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libselinux1@2.7-2build2", }, Version: "2.7", @@ -1074,7 +1074,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libsemanage-common@2.7-2build2", Name: "libsemanage-common", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libsemanage-common@2.7-2build2", }, Version: "2.7", @@ -1088,7 +1088,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libsemanage1@2.7-2build2", Name: "libsemanage1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libsemanage1@2.7-2build2", }, Version: "2.7", @@ -1110,7 +1110,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libsepol1@2.7-1", Name: "libsepol1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libsepol1@2.7-1", }, Version: "2.7", @@ -1127,7 +1127,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libsmartcols1@2.31.1-0.4ubuntu3.1", Name: "libsmartcols1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libsmartcols1@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -1144,7 +1144,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libss2@1.44.1-1", Name: "libss2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libss2@1.44.1-1", }, Version: "1.44.1", @@ -1162,7 +1162,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libstdc++6@8-20180414-1ubuntu2", Name: "libstdc++6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libstdc%2B%2B6@8-20180414-1ubuntu2", }, Version: "8-20180414", @@ -1181,7 +1181,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libsystemd0@237-3ubuntu10.3", Name: "libsystemd0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libsystemd0@237-3ubuntu10.3", }, Version: "237", @@ -1195,7 +1195,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libtasn1-6@4.13-2", Name: "libtasn1-6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libtasn1-6@4.13-2", }, Version: "4.13", @@ -1212,7 +1212,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libtinfo5@6.1-1ubuntu1.18.04", Name: "libtinfo5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libtinfo5@6.1-1ubuntu1.18.04", }, Version: "6.1", @@ -1229,7 +1229,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libudev1@237-3ubuntu10.3", Name: "libudev1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libudev1@237-3ubuntu10.3", }, Version: "237", @@ -1246,7 +1246,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libunistring2@0.9.9-0ubuntu1", Name: "libunistring2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libunistring2@0.9.9-0ubuntu1", }, Version: "0.9.9", @@ -1263,7 +1263,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libustr-1.0-1@1.0.4-3+b2", Name: "libustr-1.0-1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libustr-1.0-1@1.0.4-3%2Bb2", }, Version: "1.0.4", @@ -1280,7 +1280,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libuuid1@2.31.1-0.4ubuntu3.1", Name: "libuuid1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libuuid1@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -1297,7 +1297,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libzstd1@1.3.3+dfsg-2ubuntu1", Name: "libzstd1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libzstd1@1.3.3%2Bdfsg-2ubuntu1", }, Version: "1.3.3+dfsg", @@ -1314,7 +1314,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "login@1:4.5-1ubuntu1", Name: "login", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/login@1%3A4.5-1ubuntu1", }, Version: "4.5", @@ -1330,7 +1330,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "lsb-base@9.20170808ubuntu1", Name: "lsb-base", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/lsb-base@9.20170808ubuntu1", }, Version: "9.20170808ubuntu1", @@ -1342,7 +1342,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "mawk@1.3.3-17ubuntu3", Name: "mawk", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/mawk@1.3.3-17ubuntu3", }, Version: "1.3.3", @@ -1356,7 +1356,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "mount@2.31.1-0.4ubuntu3.1", Name: "mount", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/mount@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -1373,7 +1373,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "ncurses-base@6.1-1ubuntu1.18.04", Name: "ncurses-base", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/ncurses-base@6.1-1ubuntu1.18.04", }, Version: "6.1", @@ -1387,7 +1387,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "ncurses-bin@6.1-1ubuntu1.18.04", Name: "ncurses-bin", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/ncurses-bin@6.1-1ubuntu1.18.04", }, Version: "6.1", @@ -1401,7 +1401,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "passwd@1:4.5-1ubuntu1", Name: "passwd", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/passwd@1%3A4.5-1ubuntu1", }, Epoch: 1, @@ -1425,7 +1425,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "perl-base@5.26.1-6ubuntu0.2", Name: "perl-base", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/perl-base@5.26.1-6ubuntu0.2", }, Version: "5.26.1", @@ -1439,7 +1439,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "procps@2:3.3.12-3ubuntu1.1", Name: "procps", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/procps@2%3A3.3.12-3ubuntu1.1", }, Epoch: 2, @@ -1464,7 +1464,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "sed@4.4-2", Name: "sed", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/sed@4.4-2", }, Version: "4.4", @@ -1478,7 +1478,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "sensible-utils@0.0.12", Name: "sensible-utils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/sensible-utils@0.0.12", }, Version: "0.0.12", @@ -1490,7 +1490,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "sysvinit-utils@2.88dsf-59.10ubuntu1", Name: "sysvinit-utils", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/sysvinit-utils@2.88dsf-59.10ubuntu1", }, Version: "2.88dsf", @@ -1509,7 +1509,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "tar@1.29b-2", Name: "tar", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/tar@1.29b-2", }, Version: "1.29b", @@ -1523,7 +1523,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "ubuntu-keyring@2018.02.28", Name: "ubuntu-keyring", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/ubuntu-keyring@2018.02.28", }, Version: "2018.02.28", @@ -1535,7 +1535,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "util-linux@2.31.1-0.4ubuntu3.1", Name: "util-linux", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/util-linux@2.31.1-0.4ubuntu3.1", }, Version: "2.31.1", @@ -1552,7 +1552,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "zlib1g@1:1.2.11.dfsg-0ubuntu2", Name: "zlib1g", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/zlib1g@1%3A1.2.11.dfsg-0ubuntu2", }, Epoch: 1, @@ -1584,7 +1584,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libgcc1@1:5.1.1-12ubuntu1", Name: "libgcc1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libgcc1@1%3A5.1.1-12ubuntu1", }, Version: "5.1.1", @@ -1599,7 +1599,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libpam-modules-bin@1.1.8-3.1ubuntu3", Name: "libpam-modules-bin", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libpam-modules-bin@1.1.8-3.1ubuntu3", }, Version: "1.1.8", @@ -1613,7 +1613,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "libpam-runtime@1.1.8-3.1ubuntu3", Name: "libpam-runtime", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libpam-runtime@1.1.8-3.1ubuntu3", }, Version: "1.1.8", @@ -1627,7 +1627,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "makedev@2.3.1-93ubuntu1", Name: "makedev", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/makedev@2.3.1-93ubuntu1", }, Version: "2.3.1", @@ -1652,7 +1652,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { FilePath: "var/lib/dpkg/status", Packages: []types.Package{ { - ID: "apt@1.6.3ubuntu0.1", Name: "apt", Version: "1.6.3ubuntu0.1", Identifier: &types.PkgIdentifier{PURL: "pkg:dpkg/apt@1.6.3ubuntu0.1"}, + ID: "apt@1.6.3ubuntu0.1", Name: "apt", Version: "1.6.3ubuntu0.1", Identifier: types.PkgIdentifier{PURL: "pkg:dpkg/apt@1.6.3ubuntu0.1"}, SrcName: "apt", SrcVersion: "1.6.3ubuntu0.1", Maintainer: "Ubuntu Developers ", Arch: "amd64"}, }, }, @@ -1673,7 +1673,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "sed@4.4-2", Name: "sed", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/sed@4.4-2", }, Version: "4.4", @@ -1687,7 +1687,7 @@ func Test_dpkgAnalyzer_Analyze(t *testing.T) { { ID: "tar@1.34+dfsg-1", Name: "tar", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/tar@1.34%2Bdfsg-1", }, Version: "1.34+dfsg", diff --git a/pkg/fanal/analyzer/pkg/rpm/rpm_test.go b/pkg/fanal/analyzer/pkg/rpm/rpm_test.go index bb3217967553..f39e1b8e7f78 100644 --- a/pkg/fanal/analyzer/pkg/rpm/rpm_test.go +++ b/pkg/fanal/analyzer/pkg/rpm/rpm_test.go @@ -147,7 +147,7 @@ func Test_rpmPkgAnalyzer_listPkgs(t *testing.T) { Name: "glibc", Version: "2.17", Release: "307.el7.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:rpm/glibc@2.17-307.el7.1", }, Arch: "x86_64", @@ -187,7 +187,7 @@ func Test_rpmPkgAnalyzer_listPkgs(t *testing.T) { Name: "glibc", Version: "2.17", Release: "307.el7.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:rpm/glibc@2.17-307.el7.1", }, Arch: "x86_64", diff --git a/pkg/fanal/analyzer/pkg/rpm/rpmqa_test.go b/pkg/fanal/analyzer/pkg/rpm/rpmqa_test.go index e4543f2c684a..2ec2330a02b8 100644 --- a/pkg/fanal/analyzer/pkg/rpm/rpmqa_test.go +++ b/pkg/fanal/analyzer/pkg/rpm/rpmqa_test.go @@ -25,7 +25,7 @@ glibc 2.35-2.cm2 1653816591 1653628955 Microsoft Corporation (none) 10855265 x86 { Name: "mariner-release", Version: "2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:rpmqa/mariner-release@2.0-12.cm2", }, Release: "12.cm2", @@ -37,7 +37,7 @@ glibc 2.35-2.cm2 1653816591 1653628955 Microsoft Corporation (none) 10855265 x86 { Name: "filesystem", Version: "1.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:rpmqa/filesystem@1.1-9.cm2", }, Release: "9.cm2", @@ -49,7 +49,7 @@ glibc 2.35-2.cm2 1653816591 1653628955 Microsoft Corporation (none) 10855265 x86 { Name: "glibc", Version: "2.35", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:rpmqa/glibc@2.35-2.cm2", }, Release: "2.cm2", diff --git a/pkg/fanal/analyzer/sbom/sbom_test.go b/pkg/fanal/analyzer/sbom/sbom_test.go index 591b05ca8399..a3109dbe61b9 100644 --- a/pkg/fanal/analyzer/sbom/sbom_test.go +++ b/pkg/fanal/analyzer/sbom/sbom_test.go @@ -32,7 +32,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "co.elastic.apm:apm-agent", Version: "1.36.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent@1.36.0", @@ -41,7 +41,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "co.elastic.apm:apm-agent-cached-lookup-key", Version: "1.36.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent-cached-lookup-key@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent-cached-lookup-key@1.36.0", @@ -50,7 +50,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "co.elastic.apm:apm-agent-common", Version: "1.36.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent-common@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent-common@1.36.0", @@ -59,7 +59,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "co.elastic.apm:apm-agent-core", Version: "1.36.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent-core@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent-core@1.36.0", @@ -74,7 +74,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "elasticsearch", Version: "8.9.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:bitnami/elasticsearch@8.9.1?arch=arm64", }, Ref: "pkg:bitnami/elasticsearch@8.9.1?arch=arm64", @@ -100,7 +100,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { FilePath: "opt/bitnami/elasticsearch/modules/apm/elastic-apm-agent-1.36.0.jar", Name: "co.elastic.apm:apm-agent", Version: "1.36.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent@1.36.0", @@ -109,7 +109,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { FilePath: "opt/bitnami/elasticsearch/modules/apm/elastic-apm-agent-1.36.0.jar", Name: "co.elastic.apm:apm-agent-cached-lookup-key", Version: "1.36.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent-cached-lookup-key@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent-cached-lookup-key@1.36.0", @@ -133,7 +133,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "gdal", Version: "3.7.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:bitnami/gdal@3.7.1", }, Ref: "pkg:bitnami/gdal@3.7.1", @@ -142,7 +142,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "geos", Version: "3.8.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:bitnami/geos@3.8.3", }, Ref: "pkg:bitnami/geos@3.8.3", @@ -151,7 +151,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "postgresql", Version: "15.3.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:bitnami/postgresql@15.3.0", }, Ref: "pkg:bitnami/postgresql@15.3.0", @@ -160,7 +160,7 @@ func Test_sbomAnalyzer_Analyze(t *testing.T) { { Name: "proj", Version: "6.3.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:bitnami/proj@6.3.2", }, Ref: "pkg:bitnami/proj@6.3.2", diff --git a/pkg/fanal/artifact/image/image_test.go b/pkg/fanal/artifact/image/image_test.go index bca781e567d7..4341fb00b072 100644 --- a/pkg/fanal/artifact/image/image_test.go +++ b/pkg/fanal/artifact/image/image_test.go @@ -38,7 +38,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "alpine-baselayout@3.2.0-r3", Name: "alpine-baselayout", Version: "3.2.0-r3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/alpine-baselayout@3.2.0-r3", }, SrcName: "alpine-baselayout", @@ -84,7 +84,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "alpine-keys@2.1-r2", Name: "alpine-keys", Version: "2.1-r2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/alpine-keys@2.1-r2", }, SrcName: "alpine-keys", @@ -117,7 +117,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "apk-tools@2.10.4-r3", Name: "apk-tools", Version: "2.10.4-r3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/apk-tools@2.10.4-r3", }, SrcName: "apk-tools", @@ -139,7 +139,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "busybox@1.31.1-r9", Name: "busybox", Version: "1.31.1-r9", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/busybox@1.31.1-r9", }, SrcName: "busybox", @@ -164,7 +164,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "ca-certificates-cacert@20191127-r1", Name: "ca-certificates-cacert", Version: "20191127-r1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/ca-certificates-cacert@20191127-r1", }, SrcName: "ca-certificates", @@ -183,7 +183,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "libc-utils@0.7.2-r0", Name: "libc-utils", Version: "0.7.2-r0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/libc-utils@0.7.2-r0", }, SrcName: "libc-dev", @@ -199,7 +199,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "libcrypto1.1@1.1.1d-r3", Name: "libcrypto1.1", Version: "1.1.1d-r3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/libcrypto1.1@1.1.1d-r3", }, SrcName: "openssl", @@ -229,7 +229,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "libssl1.1@1.1.1d-r3", Name: "libssl1.1", Version: "1.1.1d-r3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/libssl1.1@1.1.1d-r3", }, SrcName: "openssl", @@ -250,7 +250,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "libtls-standalone@2.9.1-r0", Name: "libtls-standalone", Version: "2.9.1-r0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/libtls-standalone@2.9.1-r0", }, SrcName: "libtls-standalone", @@ -273,7 +273,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "musl@1.1.24-r2", Name: "musl", Version: "1.1.24-r2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl@1.1.24-r2", }, SrcName: "musl", @@ -290,7 +290,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "musl-utils@1.1.24-r2", Name: "musl-utils", Version: "1.1.24-r2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl-utils@1.1.24-r2", }, SrcName: "musl", @@ -318,7 +318,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "scanelf@1.2.4-r0", Name: "scanelf", Version: "1.2.4-r0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/scanelf@1.2.4-r0", }, SrcName: "pax-utils", @@ -337,7 +337,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "ssl_client@1.31.1-r9", Name: "ssl_client", Version: "1.31.1-r9", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/ssl_client@1.31.1-r9", }, SrcName: "busybox", @@ -357,7 +357,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "zlib@1.2.11-r3", Name: "zlib", Version: "1.2.11-r3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/zlib@1.2.11-r3", }, SrcName: "zlib", @@ -566,7 +566,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "base-files@9.9+deb9u9", Name: "base-files", Version: "9.9+deb9u9", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/base-files@9.9%2Bdeb9u9", }, SrcName: "base-files", @@ -583,7 +583,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "netbase@5.4", Name: "netbase", Version: "5.4", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/netbase@5.4", }, SrcName: "netbase", @@ -600,7 +600,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "tzdata@2019a-0+deb9u1", Name: "tzdata", Version: "2019a", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/tzdata@2019a-0%2Bdeb9u1", }, SrcName: "tzdata", @@ -659,7 +659,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "libc6@2.24-11+deb9u4", Name: "libc6", Version: "2.24", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libc6@2.24-11%2Bdeb9u4", }, Release: "11+deb9u4", @@ -678,7 +678,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "libssl1.1@1.1.0k-1~deb9u1", Name: "libssl1.1", Version: "1.1.0k", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/libssl1.1@1.1.0k-1~deb9u1", }, SrcName: "openssl", @@ -697,7 +697,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "openssl@1.1.0k-1~deb9u1", Name: "openssl", Version: "1.1.0k", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:dpkg/openssl@1.1.0k-1~deb9u1", }, SrcName: "openssl", @@ -765,7 +765,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "guzzlehttp/guzzle@6.2.0", Name: "guzzlehttp/guzzle", Version: "6.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/guzzlehttp/guzzle@6.2.0", }, Licenses: []string{"MIT"}, @@ -784,7 +784,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "guzzlehttp/promises@v1.3.1", Name: "guzzlehttp/promises", Version: "v1.3.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/guzzlehttp/promises@v1.3.1", }, Licenses: []string{"MIT"}, @@ -799,7 +799,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "guzzlehttp/psr7@1.5.2", Name: "guzzlehttp/psr7", Version: "1.5.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/guzzlehttp/psr7@1.5.2", }, Licenses: []string{"MIT"}, @@ -818,7 +818,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "laravel/installer@v2.0.1", Name: "laravel/installer", Version: "v2.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/laravel/installer@v2.0.1", }, Licenses: []string{"MIT"}, @@ -839,7 +839,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "pear/log@1.13.1", Name: "pear/log", Version: "1.13.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Licenses: []string{"MIT"}, @@ -855,7 +855,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "pear/pear_exception@v1.0.0", Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Licenses: []string{"BSD-2-Clause"}, @@ -870,7 +870,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "psr/http-message@1.0.1", Name: "psr/http-message", Version: "1.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/psr/http-message@1.0.1", }, Licenses: []string{"MIT"}, @@ -885,7 +885,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "ralouphie/getallheaders@2.0.5", Name: "ralouphie/getallheaders", Version: "2.0.5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/ralouphie/getallheaders@2.0.5", }, Licenses: []string{"MIT"}, @@ -900,7 +900,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "symfony/console@v4.2.7", Name: "symfony/console", Version: "v4.2.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/symfony/console@v4.2.7", }, Licenses: []string{"MIT"}, @@ -919,7 +919,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "symfony/contracts@v1.0.2", Name: "symfony/contracts", Version: "v1.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/symfony/contracts@v1.0.2", }, Licenses: []string{"MIT"}, @@ -934,7 +934,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "symfony/filesystem@v4.2.7", Name: "symfony/filesystem", Version: "v4.2.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/symfony/filesystem@v4.2.7", }, Licenses: []string{"MIT"}, @@ -950,7 +950,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "symfony/polyfill-ctype@v1.11.0", Name: "symfony/polyfill-ctype", Version: "v1.11.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/symfony/polyfill-ctype@v1.11.0", }, Licenses: []string{"MIT"}, @@ -965,7 +965,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "symfony/polyfill-mbstring@v1.11.0", Name: "symfony/polyfill-mbstring", Version: "v1.11.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/symfony/polyfill-mbstring@v1.11.0", }, Licenses: []string{"MIT"}, @@ -980,7 +980,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "symfony/process@v4.2.7", Name: "symfony/process", Version: "v4.2.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/symfony/process@v4.2.7", }, Licenses: []string{"MIT"}, @@ -1015,7 +1015,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "actioncable@5.2.3", Name: "actioncable", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actioncable@5.2.3", }, Indirect: true, @@ -1035,7 +1035,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "actionmailer@5.2.3", Name: "actionmailer", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actionmailer@5.2.3", }, Indirect: true, @@ -1057,7 +1057,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "actionpack@5.2.3", Name: "actionpack", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actionpack@5.2.3", }, Indirect: true, @@ -1080,7 +1080,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "actionview@5.2.3", Name: "actionview", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/actionview@5.2.3", }, Indirect: true, @@ -1102,7 +1102,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "activejob@5.2.3", Name: "activejob", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/activejob@5.2.3", }, Indirect: true, @@ -1121,7 +1121,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "activemodel@5.2.3", Name: "activemodel", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/activemodel@5.2.3", }, Indirect: true, @@ -1137,7 +1137,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "activerecord@5.2.3", Name: "activerecord", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/activerecord@5.2.3", }, Indirect: true, @@ -1157,7 +1157,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "activestorage@5.2.3", Name: "activestorage", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/activestorage@5.2.3", }, Indirect: true, @@ -1177,7 +1177,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "activesupport@5.2.3", Name: "activesupport", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/activesupport@5.2.3", }, Indirect: true, @@ -1198,7 +1198,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "arel@9.0.0", Name: "arel", Version: "9.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/arel@9.0.0", }, Indirect: true, @@ -1214,7 +1214,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "ast@2.4.0", Name: "ast", Version: "2.4.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/ast@2.4.0", }, Indirect: true, @@ -1230,7 +1230,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "builder@3.2.3", Name: "builder", Version: "3.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/builder@3.2.3", }, Indirect: true, @@ -1246,7 +1246,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "coderay@1.1.2", Name: "coderay", Version: "1.1.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/coderay@1.1.2", }, Indirect: true, @@ -1262,7 +1262,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "concurrent-ruby@1.1.5", Name: "concurrent-ruby", Version: "1.1.5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/concurrent-ruby@1.1.5", }, Indirect: true, @@ -1278,7 +1278,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "crass@1.0.4", Name: "crass", Version: "1.0.4", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/crass@1.0.4", }, Indirect: true, @@ -1294,7 +1294,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "dotenv@2.7.2", Name: "dotenv", Version: "2.7.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/dotenv@2.7.2", }, Indirect: false, @@ -1310,7 +1310,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "erubi@1.8.0", Name: "erubi", Version: "1.8.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/erubi@1.8.0", }, Indirect: true, @@ -1326,7 +1326,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "faker@1.9.3", Name: "faker", Version: "1.9.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/faker@1.9.3", }, Indirect: false, @@ -1342,7 +1342,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "globalid@0.4.2", Name: "globalid", Version: "0.4.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/globalid@0.4.2", }, Indirect: true, @@ -1358,7 +1358,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "i18n@1.6.0", Name: "i18n", Version: "1.6.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/i18n@1.6.0", }, Indirect: true, @@ -1374,7 +1374,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "jaro_winkler@1.5.2", Name: "jaro_winkler", Version: "1.5.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/jaro_winkler@1.5.2", }, Indirect: true, @@ -1390,7 +1390,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "json@2.2.0", Name: "json", Version: "2.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/json@2.2.0", }, Indirect: false, @@ -1406,7 +1406,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "loofah@2.2.3", Name: "loofah", Version: "2.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/loofah@2.2.3", }, Indirect: true, @@ -1425,7 +1425,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "mail@2.7.1", Name: "mail", Version: "2.7.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/mail@2.7.1", }, Indirect: true, @@ -1441,7 +1441,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "marcel@0.3.3", Name: "marcel", Version: "0.3.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/marcel@0.3.3", }, Indirect: true, @@ -1457,7 +1457,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "method_source@0.9.2", Name: "method_source", Version: "0.9.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/method_source@0.9.2", }, Indirect: true, @@ -1473,7 +1473,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "mimemagic@0.3.3", Name: "mimemagic", Version: "0.3.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/mimemagic@0.3.3", }, Indirect: true, @@ -1489,7 +1489,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "mini_mime@1.0.1", Name: "mini_mime", Version: "1.0.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/mini_mime@1.0.1", }, Indirect: true, @@ -1505,7 +1505,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "mini_portile2@2.4.0", Name: "mini_portile2", Version: "2.4.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/mini_portile2@2.4.0", }, Indirect: true, @@ -1521,7 +1521,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "minitest@5.11.3", Name: "minitest", Version: "5.11.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/minitest@5.11.3", }, Indirect: true, @@ -1537,7 +1537,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "nio4r@2.3.1", Name: "nio4r", Version: "2.3.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/nio4r@2.3.1", }, Indirect: true, @@ -1553,7 +1553,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "nokogiri@1.10.3", Name: "nokogiri", Version: "1.10.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/nokogiri@1.10.3", }, Indirect: true, @@ -1569,7 +1569,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "parallel@1.17.0", Name: "parallel", Version: "1.17.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/parallel@1.17.0", }, Indirect: true, @@ -1585,7 +1585,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "parser@2.6.3.0", Name: "parser", Version: "2.6.3.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/parser@2.6.3.0", }, Indirect: true, @@ -1601,7 +1601,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "pry@0.12.2", Name: "pry", Version: "0.12.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/pry@0.12.2", }, Indirect: false, @@ -1620,7 +1620,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "psych@3.1.0", Name: "psych", Version: "3.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/psych@3.1.0", }, Indirect: true, @@ -1636,7 +1636,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rack@2.0.7", Name: "rack", Version: "2.0.7", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rack@2.0.7", }, Indirect: true, @@ -1652,7 +1652,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rack-test@1.1.0", Name: "rack-test", Version: "1.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rack-test@1.1.0", }, Indirect: true, @@ -1668,7 +1668,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rails@5.2.0", Name: "rails", Version: "5.2.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rails@5.2.0", }, Indirect: false, @@ -1696,7 +1696,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rails-dom-testing@2.0.3", Name: "rails-dom-testing", Version: "2.0.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rails-dom-testing@2.0.3", }, Indirect: true, @@ -1715,7 +1715,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rails-html-sanitizer@1.0.3", Name: "rails-html-sanitizer", Version: "1.0.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rails-html-sanitizer@1.0.3", }, Indirect: true, @@ -1731,7 +1731,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "railties@5.2.3", Name: "railties", Version: "5.2.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/railties@5.2.3", }, Indirect: true, @@ -1753,7 +1753,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rainbow@3.0.0", Name: "rainbow", Version: "3.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rainbow@3.0.0", }, Indirect: true, @@ -1769,7 +1769,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rake@12.3.2", Name: "rake", Version: "12.3.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rake@12.3.2", }, Indirect: true, @@ -1785,7 +1785,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "rubocop@0.67.2", Name: "rubocop", Version: "0.67.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/rubocop@0.67.2", }, Indirect: false, @@ -1809,7 +1809,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "ruby-progressbar@1.10.0", Name: "ruby-progressbar", Version: "1.10.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/ruby-progressbar@1.10.0", }, Indirect: true, @@ -1825,7 +1825,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "sprockets@3.7.2", Name: "sprockets", Version: "3.7.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/sprockets@3.7.2", }, Indirect: true, @@ -1844,7 +1844,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "sprockets-rails@3.2.1", Name: "sprockets-rails", Version: "3.2.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/sprockets-rails@3.2.1", }, Indirect: true, @@ -1864,7 +1864,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "thor@0.20.3", Name: "thor", Version: "0.20.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/thor@0.20.3", }, Indirect: true, @@ -1880,7 +1880,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "thread_safe@0.3.6", Name: "thread_safe", Version: "0.3.6", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/thread_safe@0.3.6", }, Indirect: true, @@ -1896,7 +1896,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "tzinfo@1.2.5", Name: "tzinfo", Version: "1.2.5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/tzinfo@1.2.5", }, Indirect: true, @@ -1912,7 +1912,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "unicode-display_width@1.5.0", Name: "unicode-display_width", Version: "1.5.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/unicode-display_width@1.5.0", }, Indirect: true, @@ -1928,7 +1928,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "websocket-driver@0.7.0", Name: "websocket-driver", Version: "0.7.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/websocket-driver@0.7.0", }, Indirect: true, @@ -1944,7 +1944,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "websocket-extensions@0.1.3", Name: "websocket-extensions", Version: "0.1.3", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:gem/websocket-extensions@0.1.3", }, Indirect: true, diff --git a/pkg/fanal/artifact/image/remote_sbom_test.go b/pkg/fanal/artifact/image/remote_sbom_test.go index 750f8646b18e..91de3303316e 100644 --- a/pkg/fanal/artifact/image/remote_sbom_test.go +++ b/pkg/fanal/artifact/image/remote_sbom_test.go @@ -82,7 +82,7 @@ func TestArtifact_InspectRekorAttestation(t *testing.T) { { Name: "musl", Version: "1.2.3-r0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.2", }, SrcName: "musl", @@ -221,7 +221,7 @@ func TestArtifact_inspectOCIReferrerSBOM(t *testing.T) { { Name: "github.com/opencontainers/go-digest", Version: "v1.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/opencontainers/go-digest@v1.0.0", }, Ref: "pkg:golang/github.com/opencontainers/go-digest@v1.0.0", @@ -229,7 +229,7 @@ func TestArtifact_inspectOCIReferrerSBOM(t *testing.T) { { Name: "golang.org/x/sync", Version: "v0.1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/golang.org/x/sync@v0.1.0", }, Ref: "pkg:golang/golang.org/x/sync@v0.1.0", diff --git a/pkg/fanal/artifact/local/fs_test.go b/pkg/fanal/artifact/local/fs_test.go index 86c512f08746..fb99a3c9b7fd 100644 --- a/pkg/fanal/artifact/local/fs_test.go +++ b/pkg/fanal/artifact/local/fs_test.go @@ -62,7 +62,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "musl@1.1.24-r2", Name: "musl", Version: "1.1.24-r2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl@1.1.24-r2", }, SrcName: "musl", @@ -143,7 +143,7 @@ func TestArtifact_Inspect(t *testing.T) { ID: "musl@1.1.24-r2", Name: "musl", Version: "1.1.24-r2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl@1.1.24-r2", }, SrcName: "musl", @@ -192,7 +192,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "Flask", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/flask@2.0.0", }, }, @@ -230,7 +230,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "Flask", Version: "2.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:pypi/flask@2.0.0", }, }, diff --git a/pkg/fanal/artifact/sbom/sbom_test.go b/pkg/fanal/artifact/sbom/sbom_test.go index fc424cb8e9c0..84863412a801 100644 --- a/pkg/fanal/artifact/sbom/sbom_test.go +++ b/pkg/fanal/artifact/sbom/sbom_test.go @@ -42,7 +42,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "musl", Version: "1.2.3-r0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", }, SrcName: "musl", @@ -64,7 +64,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -76,7 +76,7 @@ func TestArtifact_Inspect(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -93,7 +93,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "github.com/package-url/packageurl-go", Version: "v0.1.1-0.20220203205134-d70459300c8a", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", }, Ref: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", @@ -111,7 +111,7 @@ func TestArtifact_Inspect(t *testing.T) { Name: "org.codehaus.mojo:child-project", Ref: "pkg:maven/org.codehaus.mojo/child-project@1.0?file_path=app%2Fmaven%2Ftarget%2Fchild-project-1.0.jar", Version: "1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/org.codehaus.mojo/child-project@1.0?file_path=app%2Fmaven%2Ftarget%2Fchild-project-1.0.jar", }, Layer: types.Layer{ @@ -128,7 +128,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "bootstrap", Version: "5.0.2", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/bootstrap@5.0.2?file_path=app%2Fapp%2Fpackage.json", }, Ref: "pkg:npm/bootstrap@5.0.2?file_path=app%2Fapp%2Fpackage.json", @@ -172,7 +172,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "musl", Version: "1.2.3-r0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", }, SrcName: "musl", @@ -194,7 +194,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -206,7 +206,7 @@ func TestArtifact_Inspect(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -223,7 +223,7 @@ func TestArtifact_Inspect(t *testing.T) { { Name: "github.com/package-url/packageurl-go", Version: "v0.1.1-0.20220203205134-d70459300c8a", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", }, Ref: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", @@ -241,7 +241,7 @@ func TestArtifact_Inspect(t *testing.T) { Name: "org.codehaus.mojo:child-project", Ref: "pkg:maven/org.codehaus.mojo/child-project@1.0?file_path=app%2Fmaven%2Ftarget%2Fchild-project-1.0.jar", Version: "1.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:maven/org.codehaus.mojo/child-project@1.0?file_path=app%2Fmaven%2Ftarget%2Fchild-project-1.0.jar", }, Layer: types.Layer{ @@ -259,7 +259,7 @@ func TestArtifact_Inspect(t *testing.T) { Name: "bootstrap", Version: "5.0.2", Ref: "pkg:npm/bootstrap@5.0.2?file_path=app%2Fapp%2Fpackage.json", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:npm/bootstrap@5.0.2?file_path=app%2Fapp%2Fpackage.json", }, Licenses: []string{"MIT"}, diff --git a/pkg/fanal/artifact/vm/vm_test.go b/pkg/fanal/artifact/vm/vm_test.go index b02e54796f53..3227b40af6d9 100644 --- a/pkg/fanal/artifact/vm/vm_test.go +++ b/pkg/fanal/artifact/vm/vm_test.go @@ -236,7 +236,7 @@ var expectedBlobInfo = types.BlobInfo{ ID: "musl@1.2.3-r5", Name: "musl", Version: "1.2.3-r5", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:apk/musl@1.2.3-r5", }, SrcName: "musl", diff --git a/pkg/fanal/handler/unpackaged/unpackaged_test.go b/pkg/fanal/handler/unpackaged/unpackaged_test.go index 665d4e6b2ef3..12672eb47044 100644 --- a/pkg/fanal/handler/unpackaged/unpackaged_test.go +++ b/pkg/fanal/handler/unpackaged/unpackaged_test.go @@ -45,7 +45,7 @@ func Test_unpackagedHook_Handle(t *testing.T) { Name: "github.com/spf13/cobra", Version: "1.5.0", Ref: "pkg:golang/github.com/spf13/cobra@1.5.0", - Identifier: &types.PkgIdentifier{ + Identifier: types.PkgIdentifier{ PURL: "pkg:golang/github.com/spf13/cobra@1.5.0", }, }, diff --git a/pkg/fanal/types/artifact.go b/pkg/fanal/types/artifact.go index e6c103a500d9..1020f90f109b 100644 --- a/pkg/fanal/types/artifact.go +++ b/pkg/fanal/types/artifact.go @@ -65,20 +65,20 @@ type Layer struct { } type Package struct { - ID string `json:",omitempty"` - Name string `json:",omitempty"` - Identifier *PkgIdentifier `json:",omitempty"` - Version string `json:",omitempty"` - Release string `json:",omitempty"` - Epoch int `json:",omitempty"` - Arch string `json:",omitempty"` - Dev bool `json:",omitempty"` - SrcName string `json:",omitempty"` - SrcVersion string `json:",omitempty"` - SrcRelease string `json:",omitempty"` - SrcEpoch int `json:",omitempty"` - Licenses []string `json:",omitempty"` - Maintainer string `json:",omitempty"` + ID string `json:",omitempty"` + Name string `json:",omitempty"` + Identifier PkgIdentifier `json:",omitempty"` + Version string `json:",omitempty"` + Release string `json:",omitempty"` + Epoch int `json:",omitempty"` + Arch string `json:",omitempty"` + Dev bool `json:",omitempty"` + SrcName string `json:",omitempty"` + SrcVersion string `json:",omitempty"` + SrcRelease string `json:",omitempty"` + SrcEpoch int `json:",omitempty"` + Licenses []string `json:",omitempty"` + Maintainer string `json:",omitempty"` Modularitylabel string `json:",omitempty"` // only for Red Hat based distributions BuildInfo *BuildInfo `json:",omitempty"` // only for Red Hat @@ -120,7 +120,7 @@ type PkgIdentifier struct { } // NewPkgIdentifier returns a new PkgIdentifier instance -func NewPkgIdentifier(value string) (*PkgIdentifier, error) { +func NewPkgIdentifier(value string) (PkgIdentifier, error) { var id PkgIdentifier switch { case isCPE(value): @@ -128,10 +128,14 @@ func NewPkgIdentifier(value string) (*PkgIdentifier, error) { case isPURL(value): id.PURL = value default: - return nil, errors.New("package identifier does not match any supported format") + return PkgIdentifier{}, errors.New("package identifier does not match any supported format") } - return &id, nil + return id, nil +} + +func (id PkgIdentifier) Empty() bool { + return id.CPE == "" && id.PURL == "" } func isCPE(value string) bool { diff --git a/pkg/module/serialize/types_easyjson.go b/pkg/module/serialize/types_easyjson.go index 601d252cf48f..8aa8d83da2b2 100644 --- a/pkg/module/serialize/types_easyjson.go +++ b/pkg/module/serialize/types_easyjson.go @@ -1617,15 +1617,7 @@ func easyjson6601e8cdDecodeGithubComAquasecurityTrivyPkgTypes(in *jlexer.Lexer, case "PkgPath": out.PkgPath = string(in.String()) case "PkgIdentifier": - if in.IsNull() { - in.Skip() - out.PkgIdentifier = nil - } else { - if out.PkgIdentifier == nil { - out.PkgIdentifier = new(types1.PkgIdentifier) - } - easyjson6601e8cdDecodeGithubComAquasecurityTrivyPkgFanalTypes9(in, out.PkgIdentifier) - } + easyjson6601e8cdDecodeGithubComAquasecurityTrivyPkgFanalTypes9(in, &out.PkgIdentifier) case "InstalledVersion": out.InstalledVersion = string(in.String()) case "FixedVersion": @@ -1845,7 +1837,7 @@ func easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgTypes(out *jwriter.Write } out.String(string(in.PkgPath)) } - if in.PkgIdentifier != nil { + if true { const prefix string = ",\"PkgIdentifier\":" if first { first = false @@ -1853,7 +1845,7 @@ func easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgTypes(out *jwriter.Write } else { out.RawString(prefix) } - easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgFanalTypes9(out, *in.PkgIdentifier) + easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgFanalTypes9(out, in.PkgIdentifier) } if in.InstalledVersion != "" { const prefix string = ",\"InstalledVersion\":" @@ -2314,15 +2306,7 @@ func easyjson6601e8cdDecodeGithubComAquasecurityTrivyPkgFanalTypes(in *jlexer.Le case "Name": out.Name = string(in.String()) case "Identifier": - if in.IsNull() { - in.Skip() - out.Identifier = nil - } else { - if out.Identifier == nil { - out.Identifier = new(types1.PkgIdentifier) - } - easyjson6601e8cdDecodeGithubComAquasecurityTrivyPkgFanalTypes9(in, out.Identifier) - } + easyjson6601e8cdDecodeGithubComAquasecurityTrivyPkgFanalTypes9(in, &out.Identifier) case "Version": out.Version = string(in.String()) case "Release": @@ -2487,7 +2471,7 @@ func easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgFanalTypes(out *jwriter. } out.String(string(in.Name)) } - if in.Identifier != nil { + if true { const prefix string = ",\"Identifier\":" if first { first = false @@ -2495,7 +2479,7 @@ func easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgFanalTypes(out *jwriter. } else { out.RawString(prefix) } - easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgFanalTypes9(out, *in.Identifier) + easyjson6601e8cdEncodeGithubComAquasecurityTrivyPkgFanalTypes9(out, in.Identifier) } if in.Version != "" { const prefix string = ",\"Version\":" diff --git a/pkg/purl/purl.go b/pkg/purl/purl.go index 200e7e802546..774cd44307b7 100644 --- a/pkg/purl/purl.go +++ b/pkg/purl/purl.go @@ -199,15 +199,15 @@ func (p *PackageURL) BOMRef() string { } // NewPackageIdentifier creates a new package identifier based on PURL for the given package. -func NewPackageIdentifier(target ftypes.TargetType, pkg ftypes.Package) *ftypes.PkgIdentifier { +func NewPackageIdentifier(target ftypes.TargetType, pkg ftypes.Package) ftypes.PkgIdentifier { pkgURL, err := NewPackageURL(target, types.Metadata{}, pkg) if err != nil || pkgURL == nil || pkgURL.Type == "" { - return nil + return ftypes.PkgIdentifier{} } pkgIdentifier, err := ftypes.NewPkgIdentifier(pkgURL.String()) if err != nil { - return nil + return ftypes.PkgIdentifier{} } return pkgIdentifier diff --git a/pkg/result/filter_test.go b/pkg/result/filter_test.go index e36ed61e0a75..bcd72d00e283 100644 --- a/pkg/result/filter_test.go +++ b/pkg/result/filter_test.go @@ -152,7 +152,7 @@ func TestFilter(t *testing.T) { { VulnerabilityID: "CVE-2019-0001", PkgName: "foo", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/foo@1.2.3", }, InstalledVersion: "1.2.3", @@ -164,7 +164,7 @@ func TestFilter(t *testing.T) { { VulnerabilityID: "CVE-2019-0001", PkgName: "bar", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/bar@1.2.3", }, InstalledVersion: "1.2.3", @@ -193,7 +193,7 @@ func TestFilter(t *testing.T) { { VulnerabilityID: "CVE-2019-0001", PkgName: "bar", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:golang/github.com/aquasecurity/bar@1.2.3", }, InstalledVersion: "1.2.3", diff --git a/pkg/rpc/convert.go b/pkg/rpc/convert.go index d75be34b5078..3a5466de287a 100644 --- a/pkg/rpc/convert.go +++ b/pkg/rpc/convert.go @@ -74,8 +74,8 @@ func ConvertToRPCPkgs(pkgs []ftypes.Package) []*common.Package { return rpcPkgs } -func ConvertToRPCPkgIdentifier(pkg *ftypes.PkgIdentifier) *common.PkgIdentifier { - if pkg == nil { +func ConvertToRPCPkgIdentifier(pkg ftypes.PkgIdentifier) *common.PkgIdentifier { + if pkg.Empty() { return nil } @@ -212,12 +212,12 @@ func ConvertFromRPCPkgs(rpcPkgs []*common.Package) []ftypes.Package { return pkgs } -func ConvertFromRPCPkgIdentifier(pkg *common.PkgIdentifier) *ftypes.PkgIdentifier { +func ConvertFromRPCPkgIdentifier(pkg *common.PkgIdentifier) ftypes.PkgIdentifier { if pkg == nil { - return nil + return ftypes.PkgIdentifier{} } - return &ftypes.PkgIdentifier{ + return ftypes.PkgIdentifier{ PURL: pkg.Purl, CPE: pkg.Cpe, } diff --git a/pkg/sbom/cyclonedx/unmarshal_test.go b/pkg/sbom/cyclonedx/unmarshal_test.go index 5c262e84b433..b505f64f17ed 100644 --- a/pkg/sbom/cyclonedx/unmarshal_test.go +++ b/pkg/sbom/cyclonedx/unmarshal_test.go @@ -37,7 +37,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { SrcName: "musl", SrcVersion: "1.2.3-r0", Licenses: []string{"MIT"}, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", }, Ref: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", @@ -56,7 +56,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -68,7 +68,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -85,7 +85,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "github.com/package-url/packageurl-go", Version: "v0.1.1-0.20220203205134-d70459300c8a", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", }, Ref: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", @@ -101,7 +101,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Libraries: ftypes.Packages{ { Name: "com.example:example", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/com.example/example@0.0.1", }, Ref: "pkg:maven/com.example/example@0.0.1", @@ -117,7 +117,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Libraries: ftypes.Packages{ { Name: "org.codehaus.mojo:child-project", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/org.codehaus.mojo/child-project@1.0?file_path=app%2Fmaven%2Ftarget%2Fchild-project-1.0.jar", }, Ref: "pkg:maven/org.codehaus.mojo/child-project@1.0?file_path=app%2Fmaven%2Ftarget%2Fchild-project-1.0.jar", @@ -136,7 +136,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "bootstrap", Version: "5.0.2", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:npm/bootstrap@5.0.2?file_path=app%2Fapp%2Fpackage.json", }, Ref: "pkg:npm/bootstrap@5.0.2?file_path=app%2Fapp%2Fpackage.json", @@ -171,7 +171,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "docker", Version: "24.0.4", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:golang/docker@24.0.4", }, Ref: "pkg:golang/docker@24.0.4", @@ -188,7 +188,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "k8s.io/apiserver", Version: "1.27.4", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:k8s/k8s.io%2Fapiserver@1.27.4", }, Ref: "pkg:k8s/k8s.io%2Fapiserver@1.27.4", @@ -196,7 +196,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "k8s.io/controller-manager", Version: "1.27.4", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:k8s/k8s.io%2Fcontroller-manager@1.27.4", }, Ref: "pkg:k8s/k8s.io%2Fcontroller-manager@1.27.4", @@ -204,7 +204,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "k8s.io/kube-proxy", Version: "1.27.4", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:k8s/k8s.io%2Fkube-proxy@1.27.4", }, Ref: "pkg:k8s/k8s.io%2Fkube-proxy@1.27.4", @@ -212,7 +212,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "k8s.io/kube-scheduler", Version: "1.27.4", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:k8s/k8s.io%2Fkube-scheduler@1.27.4", }, Ref: "pkg:k8s/k8s.io%2Fkube-scheduler@1.27.4", @@ -220,7 +220,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "k8s.io/kubelet", Version: "1.27.4", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:k8s/k8s.io%2Fkubelet@1.27.4", }, Ref: "pkg:k8s/k8s.io%2Fkubelet@1.27.4", @@ -228,7 +228,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "k8s.io/kubernetes", Version: "1.27.4", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:k8s/k8s.io%2Fkubernetes@1.27.4", }, Ref: "pkg:k8s/k8s.io%2Fkubernetes@1.27.4", @@ -261,7 +261,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { "GPL-2.0", "GFDL-1.3", }, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:deb/ubuntu/libc6@2.35-0ubuntu3.1?distro=ubuntu-22.04", }, Ref: "pkg:deb/ubuntu/libc6@2.35-0ubuntu3.1?distro=ubuntu-22.04", @@ -279,7 +279,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { SrcVersion: "4.4.27", SrcRelease: "1", SrcEpoch: 1, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:deb/ubuntu/libcrypt1@4.4.27-1?epoch=1&distro=ubuntu-22.04", }, Ref: "pkg:deb/ubuntu/libcrypt1@4.4.27-1?epoch=1&distro=ubuntu-22.04", @@ -310,7 +310,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { SrcName: "musl", SrcVersion: "1.2.3-r0", Licenses: []string{"MIT"}, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", }, Ref: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", @@ -326,7 +326,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -335,7 +335,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -357,7 +357,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -379,7 +379,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -388,7 +388,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -410,7 +410,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/core", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/core@1.13.1", }, Ref: "pkg:composer/pear/core@1.13.1", @@ -418,7 +418,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -427,7 +427,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -448,7 +448,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "org.springframework:spring-web", Version: "5.3.22", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/org.springframework/spring-web@5.3.22?file_path=spring-web-5.3.22.jar", }, Ref: "pkg:maven/org.springframework/spring-web@5.3.22?file_path=spring-web-5.3.22.jar", diff --git a/pkg/sbom/spdx/unmarshal_test.go b/pkg/sbom/spdx/unmarshal_test.go index 0b9fd12e0630..954ac6807ce3 100644 --- a/pkg/sbom/spdx/unmarshal_test.go +++ b/pkg/sbom/spdx/unmarshal_test.go @@ -38,7 +38,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { SrcName: "musl", SrcVersion: "1.2.3-r0", Licenses: []string{"MIT"}, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", }, Ref: "pkg:apk/alpine/musl@1.2.3-r0?distro=3.16.0", @@ -57,7 +57,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -69,7 +69,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -86,7 +86,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "github.com/package-url/packageurl-go", Version: "v0.1.1-0.20220203205134-d70459300c8a", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", }, Ref: "pkg:golang/github.com/package-url/packageurl-go@v0.1.1-0.20220203205134-d70459300c8a", @@ -101,7 +101,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Libraries: ftypes.Packages{ { Name: "org.codehaus.mojo:child-project", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/org.codehaus.mojo/child-project@1.0", }, Ref: "pkg:maven/org.codehaus.mojo/child-project@1.0", @@ -118,7 +118,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "bootstrap", Version: "5.0.2", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:npm/bootstrap@5.0.2", }, Ref: "pkg:npm/bootstrap@5.0.2", @@ -145,7 +145,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "yargs-parser", Version: "21.1.1", Licenses: []string{"ISC"}, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:npm/yargs-parser@21.1.1", }, Ref: "pkg:npm/yargs-parser@21.1.1", @@ -169,7 +169,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "yargs-parser", Version: "21.1.1", Licenses: []string{"ISC"}, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:npm/yargs-parser@21.1.1", }, Ref: "pkg:npm/yargs-parser@21.1.1", @@ -193,7 +193,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "yargs-parser", Version: "21.1.1", Licenses: []string{"ISC"}, - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:npm/yargs-parser@21.1.1", }, Ref: "pkg:npm/yargs-parser@21.1.1", @@ -216,7 +216,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { { Name: "pear/log", Version: "1.13.1", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/log@1.13.1", }, Ref: "pkg:composer/pear/log@1.13.1", @@ -225,7 +225,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { Name: "pear/pear_exception", Version: "v1.0.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:composer/pear/pear_exception@v1.0.0", }, Ref: "pkg:composer/pear/pear_exception@v1.0.0", @@ -247,7 +247,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { FilePath: "modules/apm/elastic-apm-agent-1.36.0.jar", Name: "co.elastic.apm:apm-agent", Version: "1.36.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent@1.36.0", @@ -256,7 +256,7 @@ func TestUnmarshaler_Unmarshal(t *testing.T) { FilePath: "modules/apm/elastic-apm-agent-1.36.0.jar", Name: "co.elastic.apm:apm-agent-cached-lookup-key", Version: "1.36.0", - Identifier: &ftypes.PkgIdentifier{ + Identifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/co.elastic.apm/apm-agent-cached-lookup-key@1.36.0", }, Ref: "pkg:maven/co.elastic.apm/apm-agent-cached-lookup-key@1.36.0", diff --git a/pkg/types/vulnerability.go b/pkg/types/vulnerability.go index 899b4b45fda0..80a6119ad216 100644 --- a/pkg/types/vulnerability.go +++ b/pkg/types/vulnerability.go @@ -7,18 +7,18 @@ import ( // DetectedVulnerability holds the information of detected vulnerabilities type DetectedVulnerability struct { - VulnerabilityID string `json:",omitempty"` - VendorIDs []string `json:",omitempty"` - PkgID string `json:",omitempty"` // It is used to construct dependency graph. - PkgName string `json:",omitempty"` - PkgPath string `json:",omitempty"` // This field is populated in the case of language-specific packages such as egg/wheel and gemspec - PkgIdentifier *ftypes.PkgIdentifier `json:",omitempty"` - InstalledVersion string `json:",omitempty"` - FixedVersion string `json:",omitempty"` - Status types.Status `json:",omitempty"` - Layer ftypes.Layer `json:",omitempty"` - SeveritySource types.SourceID `json:",omitempty"` - PrimaryURL string `json:",omitempty"` + VulnerabilityID string `json:",omitempty"` + VendorIDs []string `json:",omitempty"` + PkgID string `json:",omitempty"` // It is used to construct dependency graph. + PkgName string `json:",omitempty"` + PkgPath string `json:",omitempty"` // This field is populated in the case of language-specific packages such as egg/wheel and gemspec + PkgIdentifier ftypes.PkgIdentifier `json:",omitempty"` + InstalledVersion string `json:",omitempty"` + FixedVersion string `json:",omitempty"` + Status types.Status `json:",omitempty"` + Layer ftypes.Layer `json:",omitempty"` + SeveritySource types.SourceID `json:",omitempty"` + PrimaryURL string `json:",omitempty"` // PkgRef is populated only when scanning SBOM and contains the reference ID used in the SBOM. // It could be PURL, UUID, etc. diff --git a/pkg/vex/vex.go b/pkg/vex/vex.go index 52c47db2345a..d24003c92c88 100644 --- a/pkg/vex/vex.go +++ b/pkg/vex/vex.go @@ -50,7 +50,7 @@ func newOpenVEX(vex openvex.VEX) VEX { func (v *OpenVEX) Filter(vulns []types.DetectedVulnerability) []types.DetectedVulnerability { return lo.Filter(vulns, func(vuln types.DetectedVulnerability, _ int) bool { - if vuln.PkgIdentifier == nil { + if vuln.PkgIdentifier.Empty() { return true } @@ -138,7 +138,7 @@ func (v *CycloneDX) affected(vuln types.DetectedVulnerability, stmt Statement) b zap.Int("version", link.Version())) continue } - if vuln.PkgIdentifier != nil && + if !vuln.PkgIdentifier.Empty() && (vuln.PkgIdentifier.CPE == link.Reference() || vuln.PkgIdentifier.PURL == link.Reference()) && (stmt.Status == StatusNotAffected || stmt.Status == StatusFixed) { v.logger.Infow("Filtered out the detected vulnerability", zap.String("vulnerability-id", vuln.VulnerabilityID), diff --git a/pkg/vex/vex_test.go b/pkg/vex/vex_test.go index 51651b8f887a..e8cd378761a5 100644 --- a/pkg/vex/vex_test.go +++ b/pkg/vex/vex_test.go @@ -43,7 +43,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2021-44228", PkgName: "spring-boot", InstalledVersion: "2.6.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/org.springframework.boot/spring-boot@2.6.0", }, }, @@ -62,7 +62,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2021-44228", PkgName: "spring-boot", InstalledVersion: "2.6.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/org.springframework.boot/spring-boot@2.6.0", }, }, @@ -70,7 +70,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2021-0001", PkgName: "spring-boot", InstalledVersion: "2.6.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/org.springframework.boot/spring-boot@2.6.0", }, }, @@ -81,7 +81,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2021-0001", PkgName: "spring-boot", InstalledVersion: "2.6.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/org.springframework.boot/spring-boot@2.6.0", }, }, @@ -104,7 +104,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2018-7489", PkgName: "jackson-databind", InstalledVersion: "2.8.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.8.0", }, }, @@ -112,7 +112,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2018-7490", PkgName: "jackson-databind", InstalledVersion: "2.8.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.8.0", }, }, @@ -123,7 +123,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2018-7490", PkgName: "jackson-databind", InstalledVersion: "2.8.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.8.0", }, }, @@ -146,7 +146,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2018-7489", PkgName: "jackson-databind", InstalledVersion: "2.8.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.8.0", }, }, @@ -157,7 +157,7 @@ func TestVEX_Filter(t *testing.T) { VulnerabilityID: "CVE-2018-7489", PkgName: "jackson-databind", InstalledVersion: "2.8.0", - PkgIdentifier: &ftypes.PkgIdentifier{ + PkgIdentifier: ftypes.PkgIdentifier{ PURL: "pkg:maven/com.fasterxml.jackson.core/jackson-databind@2.8.0", }, },