internal/scan: trim the newlines off the GoVersion
Fixes golang/go#61330
Change-Id: I778cec302f71baeb3b7d3ddb4fdbf492f5079bf2
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/509275
Run-TryBot: Ian Cottrell <iancottrell@google.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
Auto-Submit: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/internal/scan/run.go b/internal/scan/run.go
index fe452cf..83bc88d 100644
--- a/internal/scan/run.go
+++ b/internal/scan/run.go
@@ -82,7 +82,7 @@
}
if cfg.GoVersion == "" {
if out, err := exec.Command("go", "env", "GOVERSION").Output(); err == nil {
- cfg.GoVersion = string(out)
+ cfg.GoVersion = strings.TrimSpace(string(out))
}
}
}