From 122c809ebf2367fd3394cfcc7d9459ce708052c9 Mon Sep 17 00:00:00 2001 From: Zvonimir Pavlinovic Date: Tue, 23 Apr 2024 18:34:50 +0000 Subject: [PATCH] internal/vulncheck: emit progress message instead of warning Now that progress messages are hidden under the verbose flag, we should not be printing anything with fmt. Change-Id: I30b247ca1793ea7bcc6e4a68e1f0633d3262d7f1 Reviewed-on: https://go-review.googlesource.com/c/vuln/+/581276 LUCI-TryBot-Result: Go LUCI Run-TryBot: Zvonimir Pavlinovic TryBot-Result: Gopher Robot Reviewed-by: Ian Cottrell --- internal/vulncheck/binary.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/vulncheck/binary.go b/internal/vulncheck/binary.go index 243dfb5..2138692 100644 --- a/internal/vulncheck/binary.go +++ b/internal/vulncheck/binary.go @@ -68,7 +68,10 @@ func binary(ctx context.Context, handler govulncheck.Handler, bin *Bin, cfg *gov } if bin.GOOS == "" || bin.GOARCH == "" { - fmt.Printf("warning: failed to extract build system specification GOOS: %s GOARCH: %s\n", bin.GOOS, bin.GOARCH) + p := &govulncheck.Progress{Message: fmt.Sprintf("warning: failed to extract build system specification GOOS: %s GOARCH: %s\n", bin.GOOS, bin.GOARCH)} + if err := handler.Progress(p); err != nil { + return nil, err + } } affVulns := affectingVulnerabilities(mv, bin.GOOS, bin.GOARCH) if err := emitModuleFindings(handler, affVulns); err != nil {