You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, this incorrectly treats file.go:1 as filename and 2 as line number.
This causes issues because such lines are very common in practice, and the leading newline alone is enough to trigger go-test matching.
I recommend restricting the go-test pattern:
Replace the \s-+ by a more precise match, e.g. four spaces.
Replace the filename group by something that is likely to be an actual filename (e.g. no spaces or colons).
The text was updated successfully, but these errors were encountered:
phst
added a commit
to phst/go-mode.el
that referenced
this issue
May 10, 2020
The regular expression to find Go test errors is currently (
go-mode.el/go-mode.el
Line 1845 in 734d523
"^\\s-+\\([^()\t\n]+\\):\\([0-9]+\\):? .*$"
. The problem is that this regex is very broad and matches too much:\s-+
also matches newlines (at least when using the standard syntax table).[^()\t\n]+
group matches a ton of things: spaces, exotic characters, NUL bytes, ...Combined, these two mean that e.g. a GNU-style
file:line:column: message
line that follows a newline is matched incorrectly:Here, this incorrectly treats
file.go:1
as filename and 2 as line number.This causes issues because such lines are very common in practice, and the leading newline alone is enough to trigger
go-test
matching.I recommend restricting the
go-test
pattern:\s-+
by a more precise match, e.g. four spaces.The text was updated successfully, but these errors were encountered: