mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
plumb context through catalogers (#2528)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package rust
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
rustaudit "github.com/microsoft/go-rustaudit"
|
||||
@@ -14,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
// Catalog identifies executables then attempts to read Rust dependency information from them
|
||||
func parseAuditBinary(_ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
|
||||
func parseAuditBinary(_ context.Context, _ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
|
||||
var pkgs []pkg.Package
|
||||
|
||||
unionReader, err := unionreader.GetUnionReader(reader.ReadCloser)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package rust
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/pelletier/go-toml"
|
||||
@@ -18,7 +19,7 @@ type cargoLockFile struct {
|
||||
}
|
||||
|
||||
// parseCargoLock is a parser function for Cargo.lock contents, returning all rust cargo crates discovered.
|
||||
func parseCargoLock(_ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
|
||||
func parseCargoLock(_ context.Context, _ file.Resolver, _ *generic.Environment, reader file.LocationReadCloser) ([]pkg.Package, []artifact.Relationship, error) {
|
||||
tree, err := toml.LoadReader(reader)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("unable to load Cargo.lock for parsing: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user