-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
html/template: parse failures lack sufficient context for debugging #20773
Comments
I'll triage this for Go1.10, but if someone thinks this should be for Unplanned, please feel free and change that. |
This may be a partial dup of #19408, which is about column information. Other than that I think we need specific examples to improve. Show us a bad template, and the error you get, and how the error could be better. Thanks. |
What's the best way to share such examples? Is there an @google.com email alias that I can share with privately? |
Any idea when this might be addressed? Just ran smack into it when trying to make changes to a golang project:
There's no line number in this error message and I have no idea aside from just commenting out vast swaths of template how to start finding the problem. |
Im using Go 1.11, I have just hit this error as well. It is not clear to me where in the template might be the problem. |
@skimbrel I opened #30635 to track your specific error, which is not what this bug is about. The issue with your problem is that the provided template ends unexpectedly. That error is saying "unexpected EOF while parsing". About this bug: how would you thing should errors be reported? @zaddok could you please post here your errors and what you'd like to have instead? |
replace <textarea id="story" name="story" rows="5" cols="33"> it works fine |
literally close it |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Unsure; this is in the Blaze version of "go_binary", "go_library", etc. (I'm having difficulty understanding which particular version of Go that is invoking).
What operating system and processor architecture are you using (
go env
)?gLinux (Ubuntu 14.04.5 LTS) and also BuildRabbit
What did you do?
What did you expect to see?
When the parsing fails, I expect the error to include sufficient context to diagnose. For example:
error parsing template: template: body:3 unexpected bad character U+002D '-' in command in the vicinity of "{{end-}}"; expected " " or "}}".
What did you see instead?
The error does not give any context. For example, it prints:
Or:
... but doesn't give any surrounding context to understand what the specific error is.
The text was updated successfully, but these errors were encountered: