Skip to content

Commit

Permalink
SBOM cataloger: fix lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Beno <patrik.beno@greenhorn.sk>
  • Loading branch information
patrikbeno committed Jun 28, 2022
1 parent c5a48b3 commit b8f33ed
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions syft/pkg/cataloger/sbom/cataloger.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ import (
// NewSBOMCataloger returns a new SBOM cataloger object loaded from saved SBOM JSON.
func NewSBOMCataloger() *common.GenericCataloger {
globParsers := map[string]common.ParserFn{
"**/*.syft.json": parseSyftJson,
"**/bom.json": parseCyclonedxJson,
"**/bom.xml": parseCyclonedxXml,
"**/*.cdx.json": parseCyclonedxJson,
"**/*.cdx.xml": parseCyclonedxXml,
"**/*.spdx.json": parseSpdxJson,
"**/*.syft.json": parseSyftJSON,
"**/bom.json": parseCyclonedxJSON,
"**/bom.xml": parseCyclonedxXML,
"**/*.cdx.json": parseCyclonedxJSON,
"**/*.cdx.xml": parseCyclonedxXML,
"**/*.spdx.json": parseSpdxJSON,
"**/*.spdx": parseSpdx,
}
return common.NewGenericCataloger(nil, globParsers, "sbom-cataloger")
}

func parseSyftJson(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
func parseSyftJSON(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
return parseSBOM(path, reader, syftjson.Format())
}

func parseCyclonedxJson(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
func parseCyclonedxJSON(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
return parseSBOM(path, reader, cyclonedxjson.Format())
}

func parseCyclonedxXml(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
func parseCyclonedxXML(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
return parseSBOM(path, reader, cyclonedxxml.Format())
}

func parseSpdxJson(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
func parseSpdxJSON(path string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) {
return parseSBOM(path, reader, spdx22json.Format())
}

Expand All @@ -62,7 +62,7 @@ func parseSBOM(_ string, reader io.Reader, format sbom.Format) ([]*pkg.Package,

var packages []*pkg.Package
for _, p := range s.Artifacts.PackageCatalog.Sorted() {
x := p //copy
x := p // copy
packages = append(packages, &x)
}

Expand Down

0 comments on commit b8f33ed

Please sign in to comment.