-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: knqyf263 <[email protected]>
- Loading branch information
Showing
3 changed files
with
145 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,17 @@ import "github.com/aquasecurity/trivy/pkg/dependency/types" | |
var ( | ||
// execute go mod tidy in normal folder | ||
GoModNormal = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -39,6 +50,17 @@ var ( | |
|
||
// execute go mod tidy in replaced folder | ||
GoModReplaced = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -61,6 +83,17 @@ var ( | |
|
||
// execute go mod tidy in replaced folder | ||
GoModUnreplaced = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -83,6 +116,17 @@ var ( | |
|
||
// execute go mod tidy in replaced-with-version folder | ||
GoModReplacedWithVersion = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -105,6 +149,17 @@ var ( | |
|
||
// execute go mod tidy in replaced-with-version-mismatch folder | ||
GoModReplacedWithVersionMismatch = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -139,6 +194,17 @@ var ( | |
|
||
// execute go mod tidy in replaced-with-local-path folder | ||
GoModReplacedWithLocalPath = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -167,6 +233,17 @@ var ( | |
|
||
// execute go mod tidy in replaced-with-local-path-and-version folder | ||
GoModReplacedWithLocalPathAndVersion = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -195,6 +272,17 @@ var ( | |
|
||
// execute go mod tidy in replaced-with-local-path-and-version-mismatch folder | ||
GoModReplacedWithLocalPathAndVersionMismatch = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -229,6 +317,17 @@ var ( | |
|
||
// execute go mod tidy in go116 folder | ||
GoMod116 = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -245,6 +344,17 @@ var ( | |
|
||
// execute go mod tidy in no-go-version folder | ||
GoModNoGoVersion = []types.Library{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
ExternalReferences: []types.ExternalRef{ | ||
{ | ||
Type: types.RefVCS, | ||
URL: "https://github.com/org/repo", | ||
}, | ||
}, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,11 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { | |
Type: types.GoModule, | ||
FilePath: "go.mod", | ||
Libraries: types.Packages{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -67,6 +72,11 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { | |
Type: types.GoModule, | ||
FilePath: "go.mod", | ||
Libraries: types.Packages{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
}, | ||
{ | ||
ID: "github.com/sad/[email protected]", | ||
Name: "github.com/sad/sad", | ||
|
@@ -90,6 +100,11 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { | |
Type: types.GoModule, | ||
FilePath: "go.mod", | ||
Libraries: types.Packages{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|
@@ -125,6 +140,11 @@ func Test_gomodAnalyzer_Analyze(t *testing.T) { | |
Type: types.GoModule, | ||
FilePath: "go.mod", | ||
Libraries: types.Packages{ | ||
{ | ||
ID: "github.com/org/repo", | ||
Name: "github.com/org/repo", | ||
Relationship: types.RelationshipRoot, | ||
}, | ||
{ | ||
ID: "github.com/aquasecurity/[email protected]", | ||
Name: "github.com/aquasecurity/go-dep-parser", | ||
|