Fixes #17030.
Change-Id: Ic7f237ac7553ae0176929056e64b01667ed59066
Reviewed-on: https://go-review.googlesource.com/31351
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
// issue 1474
// important: no newline on end of next line.
-// 6g used to print <epoch> instead of bug332.go:111
-func (t *T) F() {} // ERROR "bug332"
\ No newline at end of file
+// 6g used to print <epoch> instead of bug332.go:111
+func (t *T) F() {} // ERROR "undefined: T"
\ No newline at end of file
var v Val
var pv = &v
-var _ = pv.val() // ERROR "method"
-var _ = pv.val // ERROR "method"
+var _ = pv.val() // ERROR "pv.val undefined"
+var _ = pv.val // ERROR "pv.val undefined"
matched := false
n := len(out)
for _, errmsg := range errmsgs {
- if we.re.MatchString(errmsg) {
+ // Assume errmsg says "file:line: foo".
+ // Cut leading "file:line: " to avoid accidental matching of file name instead of message.
+ text := errmsg
+ if i := strings.Index(text, " "); i >= 0 {
+ text = text[i+1:]
+ }
+ if we.re.MatchString(text) {
matched = true
} else {
out = append(out, errmsg)