-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: run
gofmt
across all files
- Loading branch information
Showing
4 changed files
with
63 additions
and
63 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 |
---|---|---|
|
@@ -47,7 +47,7 @@ func TestToSPDX23(t *testing.T) { | |
{ | ||
desc: "Package with no custom config", | ||
scanResult: &scalibr.ScanResult{ | ||
Inventories: []*extractor.Inventory{&extractor.Inventory{ | ||
Inventories: []*extractor.Inventory{{ | ||
Name: "software", Version: "1.2.3", Extractor: pipEx, | ||
}}, | ||
}, | ||
|
@@ -59,14 +59,14 @@ func TestToSPDX23(t *testing.T) { | |
DocumentNamespace: "https://spdx.google/81855ad8-681d-4d86-91e9-1e00167939cb", | ||
CreationInfo: &v2_3.CreationInfo{ | ||
Creators: []common.Creator{ | ||
common.Creator{ | ||
{ | ||
CreatorType: "Tool", | ||
Creator: "SCALIBR", | ||
}, | ||
}, | ||
}, | ||
Packages: []*v2_3.Package{ | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "main", | ||
PackageSPDXIdentifier: "SPDXRef-Package-main-52fdfc07-2182-454f-963f-5f0f9a621d72", | ||
PackageVersion: "0", | ||
|
@@ -77,7 +77,7 @@ func TestToSPDX23(t *testing.T) { | |
PackageDownloadLocation: converter.NoAssertion, | ||
IsFilesAnalyzedTagPresent: false, | ||
}, | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "software", | ||
PackageSPDXIdentifier: "SPDXRef-Package-software-9566c74d-1003-4c4d-bbbb-0407d1e2c649", | ||
PackageVersion: "1.2.3", | ||
|
@@ -89,7 +89,7 @@ func TestToSPDX23(t *testing.T) { | |
IsFilesAnalyzedTagPresent: false, | ||
PackageSourceInfo: "Identified by the python/wheelegg extractor", | ||
PackageExternalReferences: []*v2_3.PackageExternalReference{ | ||
&v2_3.PackageExternalReference{ | ||
{ | ||
Category: "PACKAGE-MANAGER", | ||
RefType: "purl", | ||
Locator: "pkg:pypi/[email protected]", | ||
|
@@ -98,7 +98,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
}, | ||
Relationships: []*v2_3.Relationship{ | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-main-52fdfc07-2182-454f-963f-5f0f9a621d72", | ||
}, | ||
|
@@ -107,7 +107,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
Relationship: "CONTAINS", | ||
}, | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-software-9566c74d-1003-4c4d-bbbb-0407d1e2c649", | ||
}, | ||
|
@@ -122,15 +122,15 @@ func TestToSPDX23(t *testing.T) { | |
{ | ||
desc: "Package with custom config", | ||
scanResult: &scalibr.ScanResult{ | ||
Inventories: []*extractor.Inventory{&extractor.Inventory{ | ||
Inventories: []*extractor.Inventory{{ | ||
Name: "software", Version: "1.2.3", Extractor: pipEx, | ||
}}, | ||
}, | ||
config: converter.SPDXConfig{ | ||
DocumentName: "Custom name", | ||
DocumentNamespace: "Custom namespace", | ||
Creators: []common.Creator{ | ||
common.Creator{ | ||
{ | ||
CreatorType: "Person", | ||
Creator: "Custom creator", | ||
}, | ||
|
@@ -144,18 +144,18 @@ func TestToSPDX23(t *testing.T) { | |
DocumentNamespace: "Custom namespace", | ||
CreationInfo: &v2_3.CreationInfo{ | ||
Creators: []common.Creator{ | ||
common.Creator{ | ||
{ | ||
CreatorType: "Tool", | ||
Creator: "SCALIBR", | ||
}, | ||
common.Creator{ | ||
{ | ||
CreatorType: "Person", | ||
Creator: "Custom creator", | ||
}, | ||
}, | ||
}, | ||
Packages: []*v2_3.Package{ | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "main", | ||
PackageSPDXIdentifier: "SPDXRef-Package-main-6694d2c4-22ac-4208-a007-2939487f6999", | ||
PackageVersion: "0", | ||
|
@@ -166,7 +166,7 @@ func TestToSPDX23(t *testing.T) { | |
PackageDownloadLocation: converter.NoAssertion, | ||
IsFilesAnalyzedTagPresent: false, | ||
}, | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "software", | ||
PackageSPDXIdentifier: "SPDXRef-Package-software-eb9d18a4-4784-445d-87f3-c67cf22746e9", | ||
PackageVersion: "1.2.3", | ||
|
@@ -178,7 +178,7 @@ func TestToSPDX23(t *testing.T) { | |
IsFilesAnalyzedTagPresent: false, | ||
PackageSourceInfo: "Identified by the python/wheelegg extractor", | ||
PackageExternalReferences: []*v2_3.PackageExternalReference{ | ||
&v2_3.PackageExternalReference{ | ||
{ | ||
Category: "PACKAGE-MANAGER", | ||
RefType: "purl", | ||
Locator: "pkg:pypi/[email protected]", | ||
|
@@ -187,7 +187,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
}, | ||
Relationships: []*v2_3.Relationship{ | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-main-6694d2c4-22ac-4208-a007-2939487f6999", | ||
}, | ||
|
@@ -196,7 +196,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
Relationship: "CONTAINS", | ||
}, | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-software-eb9d18a4-4784-445d-87f3-c67cf22746e9", | ||
}, | ||
|
@@ -213,13 +213,13 @@ func TestToSPDX23(t *testing.T) { | |
scanResult: &scalibr.ScanResult{ | ||
Inventories: []*extractor.Inventory{ | ||
// PURL field missing | ||
&extractor.Inventory{Extractor: pipEx}, | ||
{Extractor: pipEx}, | ||
// No name | ||
&extractor.Inventory{ | ||
{ | ||
Version: "1.2.3", Extractor: pipEx, | ||
}, | ||
// No version | ||
&extractor.Inventory{ | ||
{ | ||
Name: "software", Extractor: pipEx, | ||
}, | ||
}, | ||
|
@@ -232,13 +232,13 @@ func TestToSPDX23(t *testing.T) { | |
DocumentNamespace: "https://spdx.google/5fb90bad-b37c-4821-b6d9-5526a41a9504", | ||
CreationInfo: &v2_3.CreationInfo{ | ||
Creators: []common.Creator{ | ||
common.Creator{ | ||
{ | ||
CreatorType: "Tool", | ||
Creator: "SCALIBR", | ||
}, | ||
}, | ||
}, | ||
Packages: []*v2_3.Package{&v2_3.Package{ | ||
Packages: []*v2_3.Package{{ | ||
PackageName: "main", | ||
PackageSPDXIdentifier: "SPDXRef-Package-main-95af5a25-3679-41ba-a2ff-6cd471c483f1", | ||
PackageVersion: "0", | ||
|
@@ -255,7 +255,7 @@ func TestToSPDX23(t *testing.T) { | |
{ | ||
desc: "Invalid chars in package name replaced", | ||
scanResult: &scalibr.ScanResult{ | ||
Inventories: []*extractor.Inventory{&extractor.Inventory{ | ||
Inventories: []*extractor.Inventory{{ | ||
Name: "softw@re&", Version: "1.2.3", Extractor: pipEx, | ||
}}, | ||
}, | ||
|
@@ -267,14 +267,14 @@ func TestToSPDX23(t *testing.T) { | |
DocumentNamespace: "https://spdx.google/0f070244-8615-4bda-8831-3f6a8eb668d2", | ||
CreationInfo: &v2_3.CreationInfo{ | ||
Creators: []common.Creator{ | ||
common.Creator{ | ||
{ | ||
CreatorType: "Tool", | ||
Creator: "SCALIBR", | ||
}, | ||
}, | ||
}, | ||
Packages: []*v2_3.Package{ | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "main", | ||
PackageSPDXIdentifier: "SPDXRef-Package-main-680b4e7c-8b76-4a1b-9d49-d4955c848621", | ||
PackageVersion: "0", | ||
|
@@ -285,7 +285,7 @@ func TestToSPDX23(t *testing.T) { | |
PackageDownloadLocation: converter.NoAssertion, | ||
IsFilesAnalyzedTagPresent: false, | ||
}, | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "softw@re&", | ||
PackageSPDXIdentifier: "SPDXRef-Package-softw-re--6325253f-ec73-4dd7-a9e2-8bf921119c16", | ||
PackageVersion: "1.2.3", | ||
|
@@ -297,7 +297,7 @@ func TestToSPDX23(t *testing.T) { | |
IsFilesAnalyzedTagPresent: false, | ||
PackageSourceInfo: "Identified by the python/wheelegg extractor", | ||
PackageExternalReferences: []*v2_3.PackageExternalReference{ | ||
&v2_3.PackageExternalReference{ | ||
{ | ||
Category: "PACKAGE-MANAGER", | ||
RefType: "purl", | ||
Locator: "pkg:pypi/softw%40re%[email protected]", | ||
|
@@ -306,7 +306,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
}, | ||
Relationships: []*v2_3.Relationship{ | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-main-680b4e7c-8b76-4a1b-9d49-d4955c848621", | ||
}, | ||
|
@@ -315,7 +315,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
Relationship: "CONTAINS", | ||
}, | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-softw-re--6325253f-ec73-4dd7-a9e2-8bf921119c16", | ||
}, | ||
|
@@ -330,7 +330,7 @@ func TestToSPDX23(t *testing.T) { | |
{ | ||
desc: "One location reported", | ||
scanResult: &scalibr.ScanResult{ | ||
Inventories: []*extractor.Inventory{&extractor.Inventory{ | ||
Inventories: []*extractor.Inventory{{ | ||
Name: "software", Version: "1.2.3", Extractor: pipEx, Locations: []string{"/file1"}, | ||
}}, | ||
}, | ||
|
@@ -342,14 +342,14 @@ func TestToSPDX23(t *testing.T) { | |
DocumentNamespace: "https://spdx.google/6bf84c71-74cb-4476-b64c-c3dbd968b0f7", | ||
CreationInfo: &v2_3.CreationInfo{ | ||
Creators: []common.Creator{ | ||
common.Creator{ | ||
{ | ||
CreatorType: "Tool", | ||
Creator: "SCALIBR", | ||
}, | ||
}, | ||
}, | ||
Packages: []*v2_3.Package{ | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "main", | ||
PackageSPDXIdentifier: "SPDXRef-Package-main-0bf50598-7592-4e66-8a5b-df2c7fc48445", | ||
PackageVersion: "0", | ||
|
@@ -360,7 +360,7 @@ func TestToSPDX23(t *testing.T) { | |
PackageDownloadLocation: converter.NoAssertion, | ||
IsFilesAnalyzedTagPresent: false, | ||
}, | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "software", | ||
PackageSPDXIdentifier: "SPDXRef-Package-software-92d2572b-cd06-48d2-96c5-2f5054e2d083", | ||
PackageVersion: "1.2.3", | ||
|
@@ -372,7 +372,7 @@ func TestToSPDX23(t *testing.T) { | |
IsFilesAnalyzedTagPresent: false, | ||
PackageSourceInfo: "Identified by the python/wheelegg extractor from /file1", | ||
PackageExternalReferences: []*v2_3.PackageExternalReference{ | ||
&v2_3.PackageExternalReference{ | ||
{ | ||
Category: "PACKAGE-MANAGER", | ||
RefType: "purl", | ||
Locator: "pkg:pypi/[email protected]", | ||
|
@@ -381,7 +381,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
}, | ||
Relationships: []*v2_3.Relationship{ | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-main-0bf50598-7592-4e66-8a5b-df2c7fc48445", | ||
}, | ||
|
@@ -390,7 +390,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
Relationship: "CONTAINS", | ||
}, | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-software-92d2572b-cd06-48d2-96c5-2f5054e2d083", | ||
}, | ||
|
@@ -405,7 +405,7 @@ func TestToSPDX23(t *testing.T) { | |
{ | ||
desc: "Multiple locations reported", | ||
scanResult: &scalibr.ScanResult{ | ||
Inventories: []*extractor.Inventory{&extractor.Inventory{ | ||
Inventories: []*extractor.Inventory{{ | ||
Name: "software", Version: "1.2.3", Extractor: pipEx, Locations: []string{"/file1", "/file2", "/file3"}, | ||
}}, | ||
}, | ||
|
@@ -417,14 +417,14 @@ func TestToSPDX23(t *testing.T) { | |
DocumentNamespace: "https://spdx.google/255aa5b7-d44b-4c40-b84c-892b9bffd436", | ||
CreationInfo: &v2_3.CreationInfo{ | ||
Creators: []common.Creator{ | ||
common.Creator{ | ||
{ | ||
CreatorType: "Tool", | ||
Creator: "SCALIBR", | ||
}, | ||
}, | ||
}, | ||
Packages: []*v2_3.Package{ | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "main", | ||
PackageSPDXIdentifier: "SPDXRef-Package-main-172ed857-94bb-458b-8c3b-525da1786f9f", | ||
PackageVersion: "0", | ||
|
@@ -435,7 +435,7 @@ func TestToSPDX23(t *testing.T) { | |
PackageDownloadLocation: converter.NoAssertion, | ||
IsFilesAnalyzedTagPresent: false, | ||
}, | ||
&v2_3.Package{ | ||
{ | ||
PackageName: "software", | ||
PackageSPDXIdentifier: "SPDXRef-Package-software-ff094279-db19-44eb-97a1-9d0f7bbacbe0", | ||
PackageVersion: "1.2.3", | ||
|
@@ -447,7 +447,7 @@ func TestToSPDX23(t *testing.T) { | |
IsFilesAnalyzedTagPresent: false, | ||
PackageSourceInfo: "Identified by the python/wheelegg extractor from 3 locations, including /file1 and /file2", | ||
PackageExternalReferences: []*v2_3.PackageExternalReference{ | ||
&v2_3.PackageExternalReference{ | ||
{ | ||
Category: "PACKAGE-MANAGER", | ||
RefType: "purl", | ||
Locator: "pkg:pypi/[email protected]", | ||
|
@@ -456,7 +456,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
}, | ||
Relationships: []*v2_3.Relationship{ | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-main-172ed857-94bb-458b-8c3b-525da1786f9f", | ||
}, | ||
|
@@ -465,7 +465,7 @@ func TestToSPDX23(t *testing.T) { | |
}, | ||
Relationship: "CONTAINS", | ||
}, | ||
&v2_3.Relationship{ | ||
{ | ||
RefA: common.DocElementID{ | ||
ElementRefID: "SPDXRef-Package-software-ff094279-db19-44eb-97a1-9d0f7bbacbe0", | ||
}, | ||
|
@@ -511,7 +511,7 @@ func TestToCDX(t *testing.T) { | |
{ | ||
desc: "Package with custom config", | ||
scanResult: &scalibr.ScanResult{ | ||
Inventories: []*extractor.Inventory{&extractor.Inventory{ | ||
Inventories: []*extractor.Inventory{{ | ||
Name: "software", Version: "1.2.3", Extractor: pipEx, | ||
}}, | ||
}, | ||
|
Oops, something went wrong.