]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: adjust regexp that cleans cgo-related errors
authorRobert Griesemer <gri@golang.org>
Tue, 13 Jun 2017 20:05:33 +0000 (13:05 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 13 Jun 2017 20:18:40 +0000 (20:18 +0000)
The compiler now also prints column information - make sure we use
the correct regexp for compiler error cleanups. Accept both, error
positions with columns and without, since column printing may be
disabled with -gcflags=-C.

Fixes #20628.

Change-Id: I46dc921dd5c29d7b8172cd19a3df57951f60d889
Reviewed-on: https://go-review.googlesource.com/45612
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/go/internal/work/build.go

index 2dfd54171a6d98bd289aa20b6ebcc64f4832f87e..413537d9de2c245268d20c9a347ed49d4700c809 100644 (file)
@@ -1919,7 +1919,7 @@ func (b *Builder) showOutput(dir, desc, out string) {
 // print this error.
 var errPrintedOutput = errors.New("already printed output - no need to show error")
 
-var cgoLine = regexp.MustCompile(`\[[^\[\]]+\.cgo1\.go:[0-9]+\]`)
+var cgoLine = regexp.MustCompile(`\[[^\[\]]+\.cgo1\.go:[0-9]+(:[0-9]+)?\]`)
 var cgoTypeSigRe = regexp.MustCompile(`\b_Ctype_\B`)
 
 // run runs the command given by cmdline in the directory dir.