mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
chore: clean up linting configuration (#1343)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package rust
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
rustaudit "github.com/microsoft/go-rustaudit"
|
||||
|
||||
"github.com/anchore/syft/internal/log"
|
||||
@@ -42,7 +44,7 @@ func parseAuditBinaryEntry(reader unionreader.UnionReader, filename string) []ru
|
||||
versionInfo, err := rustaudit.GetDependencyInfo(r)
|
||||
|
||||
if err != nil {
|
||||
if err == rustaudit.ErrNoRustDepInfo {
|
||||
if errors.Is(err, rustaudit.ErrNoRustDepInfo) {
|
||||
// since the cataloger can only select executables and not distinguish if they are a Rust-compiled
|
||||
// binary, we should not show warnings/logs in this case.
|
||||
return nil
|
||||
|
||||
@@ -21,13 +21,13 @@ type cargoLockFile struct {
|
||||
func parseCargoLock(_ source.FileResolver, _ *generic.Environment, reader source.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: %v", err)
|
||||
return nil, nil, fmt.Errorf("unable to load Cargo.lock for parsing: %w", err)
|
||||
}
|
||||
|
||||
m := cargoLockFile{}
|
||||
err = tree.Unmarshal(&m)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("unable to parse Cargo.lock: %v", err)
|
||||
return nil, nil, fmt.Errorf("unable to parse Cargo.lock: %w", err)
|
||||
}
|
||||
|
||||
var pkgs []pkg.Package
|
||||
|
||||
Reference in New Issue
Block a user