cmd/vulnreport: better error when running symbol checks with a devel go
Change-Id: I061f9c45798355f2f34390722423704e7be8aaa0
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/662716
Reviewed-by: Neal Patel <nealpatel@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/cmd/vulnreport/fix.go b/cmd/vulnreport/fix.go
index 1b3677c..6eb75c1 100644
--- a/cmd/vulnreport/fix.go
+++ b/cmd/vulnreport/fix.go
@@ -199,6 +199,10 @@
if m.IsFirstParty() {
gover := runtime.Version()
ver := semverForGoVersion(gover)
+ if ver == "" {
+ log.Warnf("%s: current Go version %q is not a release version, skipping symbol checks for module %s", r.ID, gover, m.Module)
+ continue
+ }
// If some symbol is in the std library at a different version,
// we may derive the wrong symbols for this package and other.
// In this case, skip updating DerivedSymbols.
@@ -210,7 +214,7 @@
if err != nil {
return err
}
- if ver == "" || !affected {
+ if !affected {
log.Warnf("%s: current Go version %q is not in a vulnerable range, skipping symbol checks for module %s", r.ID, gover, m.Module)
continue
}