]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vet/all: in case of vet panic, don't filter stacktrace
authorRobert Griesemer <gri@golang.org>
Thu, 29 Jun 2017 21:14:26 +0000 (14:14 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 29 Jun 2017 23:22:38 +0000 (23:22 +0000)
Fixes #20839.

Change-Id: I125460c5da09b7fa0cf470ff5be436f8d650cde7
Reviewed-on: https://go-review.googlesource.com/47253
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/vet/all/main.go

index b4df4cc720898aab6c455962abd5c1201ef8561a..09167af6d53e632d81bd2e11eb522d896899a4f8 100644 (file)
@@ -17,6 +17,7 @@ import (
        "go/build"
        "go/types"
        "internal/testenv"
+       "io"
        "log"
        "os"
        "os/exec"
@@ -227,6 +228,15 @@ NextLine:
                        continue
                }
 
+               if strings.HasPrefix(line, "panic: ") {
+                       // Panic in vet. Don't filter anything, we want the complete output.
+                       parseFailed = true
+                       fmt.Fprintf(os.Stderr, "panic in vet (to reproduce: go run main.go -p %s):\n", p)
+                       fmt.Fprintln(os.Stderr, line)
+                       io.Copy(os.Stderr, stderr)
+                       break
+               }
+
                fields := strings.SplitN(line, ":", 3)
                var file, lineno, msg string
                switch len(fields) {