Skip to content

Commit

Permalink
fix: PkgIdentifier as value instead of pointer
Browse files Browse the repository at this point in the history
Signed-off-by: juan131 <[email protected]>
  • Loading branch information
juan131 committed Nov 17, 2023
1 parent d104f87 commit add17e8
Show file tree
Hide file tree
Showing 47 changed files with 499 additions and 511 deletions.
14 changes: 7 additions & 7 deletions pkg/fanal/analyzer/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) {
ID: "[email protected]",
Name: "musl",
Version: "1.1.24-r2",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:apk/[email protected]",
},
SrcName: "musl",
Expand Down Expand Up @@ -382,7 +382,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) {
ID: "[email protected]",
Name: "actioncable",
Version: "5.2.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:gem/[email protected]",
},
Indirect: false,
Expand All @@ -400,7 +400,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) {
ID: "[email protected]",
Name: "actionpack",
Version: "5.2.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:gem/[email protected]",
},
Indirect: true,
Expand Down Expand Up @@ -449,7 +449,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) {
ID: "[email protected]",
Name: "actioncable",
Version: "5.2.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:gem/[email protected]",
},
Indirect: false,
Expand All @@ -467,7 +467,7 @@ func TestAnalyzerGroup_AnalyzeFile(t *testing.T) {
ID: "[email protected]",
Name: "actionpack",
Version: "5.2.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:gem/[email protected]",
},
Indirect: true,
Expand Down Expand Up @@ -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/[email protected]",
},
FilePath: "testdata/post-apps/jar/jackson-annotations-2.15.0-rc2.jar",
Expand All @@ -611,7 +611,7 @@ func TestAnalyzerGroup_PostAnalyze(t *testing.T) {
ID: "[email protected]",
Name: "certifi",
Version: "2022.12.7",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:pypi/[email protected]",
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/fanal/analyzer/language/analyze_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestAnalyze(t *testing.T) {
{
Name: "test",
Version: "1.2.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:golang/[email protected]",
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/fanal/analyzer/language/c/conan/conan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]",
},
DependsOn: []string{
Expand All @@ -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/[email protected]",
},
Indirect: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/fanal/analyzer/language/conda/meta/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]",
},
Licenses: []string{"MIT"},
Expand Down
16 changes: 8 additions & 8 deletions pkg/fanal/analyzer/language/dart/pub/pubspec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "collection",
Version: "1.17.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
Indirect: true,
Expand All @@ -46,7 +46,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "crypto",
Version: "3.0.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
DependsOn: []string{
Expand All @@ -57,15 +57,15 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "meta",
Version: "1.11.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
},
{
ID: "[email protected]",
Name: "typed_data",
Version: "1.3.2",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
Indirect: true,
Expand Down Expand Up @@ -93,7 +93,7 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "collection",
Version: "1.17.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
Indirect: true,
Expand All @@ -102,23 +102,23 @@ func Test_pubSpecLockAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "crypto",
Version: "3.0.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
},
{
ID: "[email protected]",
Name: "meta",
Version: "1.11.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
},
{
ID: "[email protected]",
Name: "typed_data",
Version: "1.3.2",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:dart/[email protected]",
},
Indirect: true,
Expand Down
2 changes: 1 addition & 1 deletion pkg/fanal/analyzer/language/dotnet/deps/deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]",
},
Locations: []types.Location{
Expand Down
16 changes: 8 additions & 8 deletions pkg/fanal/analyzer/language/dotnet/nuget/nuget_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]",
},
},
{
Name: "Newtonsoft.Json",
Version: "6.0.4",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:nuget/[email protected]",
},
},
Expand All @@ -66,7 +66,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "Newtonsoft.Json",
Version: "12.0.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:nuget/[email protected]",
},
Locations: []types.Location{
Expand All @@ -81,7 +81,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "NuGet.Frameworks",
Version: "5.7.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:nuget/[email protected]",
},
Locations: []types.Location{
Expand Down Expand Up @@ -113,7 +113,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "Newtonsoft.Json",
Version: "12.0.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:nuget/[email protected]",
},
Locations: []types.Location{
Expand All @@ -128,7 +128,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "NuGet.Frameworks",
Version: "5.7.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:nuget/[email protected]",
},
Locations: []types.Location{
Expand Down Expand Up @@ -160,7 +160,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "Newtonsoft.Json",
Version: "12.0.3",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:nuget/[email protected]",
},
Locations: []types.Location{
Expand All @@ -174,7 +174,7 @@ func Test_nugetibraryAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "NuGet.Frameworks",
Version: "5.7.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:nuget/[email protected]",
},
Locations: []types.Location{
Expand Down
2 changes: 1 addition & 1 deletion pkg/fanal/analyzer/language/elixir/mix/mix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_mixLockAnalyzer_Analyze(t *testing.T) {
ID: "[email protected]",
Name: "bunt",
Version: "0.2.0",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:hex/[email protected]",
},
Locations: []types.Location{
Expand Down
6 changes: 3 additions & 3 deletions pkg/fanal/analyzer/language/golang/binary/binary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]",
},
},
{
Name: "github.com/aquasecurity/go-version",
Version: "v0.0.0-20210121072130-637058cfe492",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:golang/github.com/aquasecurity/[email protected]",
},
},
{
Name: "golang.org/x/xerrors",
Version: "v0.0.0-20200804184101-5ec99f83aff1",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:golang/golang.org/x/[email protected]",
},
},
Expand Down
12 changes: 6 additions & 6 deletions pkg/fanal/analyzer/language/golang/mod/mod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) {
ID: "github.com/aquasecurity/[email protected]",
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/[email protected]",
},
Licenses: []string{
Expand All @@ -50,7 +50,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) {
ID: "golang.org/x/[email protected]",
Name: "golang.org/x/xerrors",
Version: "0.0.0-20200804184101-5ec99f83aff1",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:golang/golang.org/x/[email protected]",
},
Indirect: true,
Expand All @@ -75,7 +75,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) {
ID: "github.com/sad/[email protected]",
Name: "github.com/sad/sad",
Version: "0.0.1",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:golang/github.com/sad/[email protected]",
},
},
Expand All @@ -100,7 +100,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) {
ID: "github.com/aquasecurity/[email protected]",
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/[email protected]",
},
DependsOn: []string{
Expand All @@ -111,7 +111,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) {
ID: "github.com/BurntSushi/[email protected]",
Name: "github.com/BurntSushi/toml",
Version: "0.3.1",
Identifier: &types.PkgIdentifier{
Identifier: types.PkgIdentifier{
PURL: "pkg:golang/github.com/burntsushi/[email protected]",
},
Indirect: true,
Expand Down Expand Up @@ -139,7 +139,7 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) {
ID: "github.com/aquasecurity/[email protected]",
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/[email protected]",
},
DependsOn: []string{},
Expand Down
2 changes: 1 addition & 1 deletion pkg/fanal/analyzer/language/java/gradle/lockfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]",
},
},
Expand Down
Loading

0 comments on commit add17e8

Please sign in to comment.