diff --git a/syft/pkg/cataloger/golang/binary_cataloger.go b/syft/pkg/cataloger/golang/binary_cataloger.go index 20b19796c..2ebd0e849 100644 --- a/syft/pkg/cataloger/golang/binary_cataloger.go +++ b/syft/pkg/cataloger/golang/binary_cataloger.go @@ -40,7 +40,6 @@ func (c *Cataloger) Name() string { // Catalog is given an object to resolve file references and content, this function returns any discovered Packages after analyzing rpm db installation. func (c *Cataloger) Catalog(resolver source.FileResolver) ([]pkg.Package, []artifact.Relationship, error) { var pkgs []pkg.Package - var relationships []artifact.Relationship fileMatches, err := resolver.FilesByMIMEType(mimeTypes...) if err != nil { @@ -53,15 +52,14 @@ func (c *Cataloger) Catalog(resolver source.FileResolver) ([]pkg.Package, []arti return pkgs, nil, fmt.Errorf("failed to resolve file contents by location: %w", err) } - goPkgs, goRelationships, err := parseGoBin(location, r) + goPkgs, err := parseGoBin(location, r) if err != nil { log.Warnf("could not parse possible go binary: %+v", err) } internal.CloseAndLogError(r, location.RealPath) pkgs = append(pkgs, goPkgs...) - relationships = append(relationships, goRelationships...) } - return pkgs, relationships, nil + return pkgs, nil, nil } diff --git a/syft/pkg/cataloger/golang/parse_go_bin.go b/syft/pkg/cataloger/golang/parse_go_bin.go index c93e71af1..a44b676a2 100644 --- a/syft/pkg/cataloger/golang/parse_go_bin.go +++ b/syft/pkg/cataloger/golang/parse_go_bin.go @@ -5,7 +5,6 @@ import ( "io" "strings" - "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" ) @@ -15,17 +14,16 @@ const ( replaceIdentifier = "=>" ) -func parseGoBin(location source.Location, reader io.ReadCloser) ([]pkg.Package, []artifact.Relationship, error) { - +func parseGoBin(location source.Location, reader io.ReadCloser) ([]pkg.Package, error) { // Identify if bin was compiled by go x, err := openExe(reader) if err != nil { - return nil, nil, err + return nil, err } goVersion, mod := findVers(x) - return buildGoPkgInfo(location, mod, goVersion), nil, nil + return buildGoPkgInfo(location, mod, goVersion), nil } func buildGoPkgInfo(location source.Location, mod, goVersion string) []pkg.Package {