aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-04-13 06:08:20 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-04-13 14:05:34 +0000
commit7fa3b79ce52a93d21beb7df0eb7b92148a9b79e5 (patch)
tree819329297027cda486c10b82ee9d42270d7da92c
parentab636b899cbfe40ad310d7b50d1a443724f5970a (diff)
downloadgo-7fa3b79ce52a93d21beb7df0eb7b92148a9b79e5.tar.xz
cmd/vet/all: print all unparseable lines
In my experience, this usually happens when vet panics. Dumping all unparseable lines should help diagnosis. Inspired by the trybot failures in CL 40511. Change-Id: Ib73e8c8b2942832589c3cc5d33ef35fdafe9965a Reviewed-on: https://go-review.googlesource.com/40508 Reviewed-by: Rob Pike <r@golang.org>
-rw-r--r--src/cmd/vet/all/main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cmd/vet/all/main.go b/src/cmd/vet/all/main.go
index 03337a4e8b..64b3a0157a 100644
--- a/src/cmd/vet/all/main.go
+++ b/src/cmd/vet/all/main.go
@@ -217,6 +217,7 @@ func (p platform) vet() {
// Process vet output.
scan := bufio.NewScanner(stderr)
+ var parseFailed bool
NextLine:
for scan.Scan() {
line := scan.Text()
@@ -235,7 +236,11 @@ NextLine:
case 3:
file, lineno, msg = fields[0], fields[1], fields[2]
default:
- log.Fatalf("could not parse vet output line:\n%s", line)
+ if !parseFailed {
+ parseFailed = true
+ fmt.Fprintln(os.Stderr, "failed to parse vet output:")
+ }
+ fmt.Println(os.Stderr, line)
}
msg = strings.TrimSpace(msg)
@@ -258,6 +263,10 @@ NextLine:
}
w[key]--
}
+ if parseFailed {
+ atomic.StoreUint32(&failed, 1)
+ return
+ }
if scan.Err() != nil {
log.Fatalf("failed to scan vet output: %v", scan.Err())
}