From 5462046fcc468ca297938e384974d975b26dc602 Mon Sep 17 00:00:00 2001 From: Jesse Becker Date: Thu, 16 Dec 2021 11:45:35 -0500 Subject: [PATCH] Make magic numbers quietable --- scanner/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scanner/main.go b/scanner/main.go index d7043a2..51bd56d 100644 --- a/scanner/main.go +++ b/scanner/main.go @@ -54,7 +54,9 @@ func handleJar(path string, ra io.ReaderAt, sz int64) { buf := bytes.NewBuffer(nil) if _, err := io.CopyN(buf, fr, 4); err != nil { if err == io.EOF { - fmt.Fprintf(logFile, "can't read magic from JAR file member: %s (%s): %v\n", path, file.Name, err) + if !quiet { + fmt.Fprintf(logFile, "can't read magic from JAR file member: %s (%s): %v\n", path, file.Name, err) + } } fr.Close() continue