From: Josh Bleecher Snyder Date: Thu, 13 Apr 2017 13:08:20 +0000 (-0700) Subject: cmd/vet/all: print all unparseable lines X-Git-Tag: go1.9beta1~706 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7fa3b79ce52a93d21beb7df0eb7b92148a9b79e5;p=gostls13.git 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 --- 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()) }