New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go/parser: misleading error location #7458
Labels
Milestone
Comments
Gah, can't type. :/ Sorry, more like this: http://play.golang.org/p/oQdKp7KQ1P I would expect the gofmt error on line 52, not 51 (the go call) Status changed to New. |
Even after commenting out the imports: http://play.golang.org/p/nkpjCROcTK I get the error message on line 52 as desired. It could be better perhaps. Is that what you are complaining about? Status changed to WaitingForReply. |
One problem is that the playground (format) only reports the first error here. If gofmt'ed explicitly, the error messages are: x.go:51:6: expected function/method call x.go:52:70: expected ')', found 'func' x.go:62:5: expected statement, found ')' x.go:72:3: expected '}', found 'EOF' The 2nd error is what you'd expect (more or less). Error messages are reported in sorted order, so even though the 2nd error is actually the first error encountered during parsing, the error on line 51 comes first (and is caused by the 2nd and its follow-up errors). The parser could be smarter about what to report (if anything) for line 51 in this case. Labels changed: added release-go1.3maybe. Status changed to Accepted. |
This issue was closed by revision 1624c73. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: