Commit 7fa3b79c authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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/40508Reviewed-by: default avatarRob Pike <r@golang.org>
parent ab636b89
......@@ -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())
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment