mirror of
https://github.com/anchore/syft.git
synced 2026-02-12 02:26:42 +01:00
fix: additional excessive go binary warnings (#1432)
The original fix b125ea83baa30dc981e82f4ddd384602f778f090 didn't catch all the excessive warnings, it seems like getArches can also be called on binaries that aren't neccessarily go binaries, so the messages from this should also be Trace instead of Warn. Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
parent
6a7d6e6071
commit
8d36b21237
@ -85,12 +85,12 @@ func makeGoMainPackage(mod *debug.BuildInfo, arch string, location source.Locati
|
|||||||
// 2) reading file headers from binaries compiled by < go1.18
|
// 2) reading file headers from binaries compiled by < go1.18
|
||||||
func getArchs(readers []io.ReaderAt, builds []*debug.BuildInfo) []string {
|
func getArchs(readers []io.ReaderAt, builds []*debug.BuildInfo) []string {
|
||||||
if len(readers) != len(builds) {
|
if len(readers) != len(builds) {
|
||||||
log.Warnf("golang cataloger: bin parsing: number of builds and readers doesn't match")
|
log.Trace("golang cataloger: bin parsing: number of builds and readers doesn't match")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(readers) == 0 || len(builds) == 0 {
|
if len(readers) == 0 || len(builds) == 0 {
|
||||||
log.Warnf("golang cataloger: bin parsing: %d readers and %d build info items", len(readers), len(builds))
|
log.Tracef("golang cataloger: bin parsing: %d readers and %d build info items", len(readers), len(builds))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ func getArchs(readers []io.ReaderAt, builds []*debug.BuildInfo) []string {
|
|||||||
for i, r := range readers {
|
for i, r := range readers {
|
||||||
a, err := getGOARCHFromBin(r)
|
a, err := getGOARCHFromBin(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnf("golang cataloger: bin parsing: getting arch from binary: %v", err)
|
log.Tracef("golang cataloger: bin parsing: getting arch from binary: %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user