Skip to content

Commit

Permalink
chore: removed whitespace in tests for static analysis check
Browse files Browse the repository at this point in the history
Signed-off-by: James Neate <[email protected]>
  • Loading branch information
jneate committed May 28, 2023
1 parent 558a210 commit 97d3292
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions grype/presenter/models/models_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func generateMatches(t *testing.T, p, p2, p3 pkg.Package) match.Matches {

matches := []match.Match{
{

Vulnerability: vulnerability.Vulnerability{
ID: "CVE-1999-0001",
Namespace: "source-1",
Expand All @@ -94,49 +93,37 @@ func generateMatches(t *testing.T, p, p2, p3 pkg.Package) match.Matches {
"version": "20.04",
},
},
Found: map[string]interface{}{
"constraint": ">= 20",
},
Found: map[string]interface{}{"constraint": ">= 20"},
},
},
},
{

Vulnerability: vulnerability.Vulnerability{
ID: "CVE-1999-0002",
Namespace: "source-2",
},
Package: p2,
Details: []match.Detail{
{
Type: match.ExactIndirectMatch,
Matcher: match.DpkgMatcher,
SearchedBy: map[string]interface{}{
"cpe": "somecpe",
},
Found: map[string]interface{}{
"constraint": "somecpe",
},
Type: match.ExactIndirectMatch,
Matcher: match.DpkgMatcher,
SearchedBy: map[string]interface{}{"cpe": "somecpe"},
Found: map[string]interface{}{"constraint": "somecpe"},
},
},
},
{

Vulnerability: vulnerability.Vulnerability{
ID: "CVE-1999-0003",
Namespace: "source-3",
},
Package: p3,
Details: []match.Detail{
{
Type: match.ExactIndirectMatch,
Matcher: match.JavascriptMatcher,
SearchedBy: map[string]interface{}{
"cpe": "somecpe",
},
Found: map[string]interface{}{
"constraint": "somecpe",
},
Type: match.ExactIndirectMatch,
Matcher: match.JavascriptMatcher,
SearchedBy: map[string]interface{}{"cpe": "somecpe"},
Found: map[string]interface{}{"constraint": "somecpe"},
},
},
},
Expand Down Expand Up @@ -168,14 +155,11 @@ func generatePackages(t *testing.T) []pkg.Package {
},
Upstreams: []pkg.UpstreamPackage{
{
Name: "nothing",
Version: "3.2",
Name: "nothing", Version: "3.2",
},
},
MetadataType: pkg.RpmMetadataType,
Metadata: pkg.RpmMetadata{
Epoch: &epoch,
},
Metadata: pkg.RpmMetadata{Epoch: &epoch},
},
{
Name: "package-2",
Expand Down Expand Up @@ -216,7 +200,6 @@ func generatePackages(t *testing.T) []pkg.Package {
for _, p := range pkgs {
id, err := artifact.IDByHash(p)
require.NoError(t, err)

p.ID = pkg.ID(id)
updatedPkgs = append(updatedPkgs, p)
}
Expand Down

0 comments on commit 97d3292

Please sign in to comment.