-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: Tree is only updated after Execute is called #43064
Comments
It's possible this is intended. If so, I'd like to request the documentation be updated to make that clearer, and the internal |
/cc @empijei |
This is intended as escaping needs to be lazily evaluated. We should probably update the doc to reflect this behavior. Would you like to try and send a CL to do so? Partially related: #39807 |
Maybe we can delete that line of comment or update the comment like this:
/cc @vktec @empijei |
What about |
@empijei Your comment would be much better, which is more concise and easier to understand. 👍 |
The current comment "The underlying template's parse tree, updated to be HTML-safe." at https://pkg.go.dev/html/template#Template is not correct Fixes golang#43064
Change https://golang.org/cl/345030 mentions this issue: |
Tree is udpated after first execution Fixes golang#43064
The underlying template's parse tree at html/template#Template, updated to be HTML-safe after the first execution. Fixes golang#43064
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/Tt61uh_jIRf
What did you expect to see?
Before
Execute
is called, theTree
should already have been "updated to be HTML-safe", as implied by the documentation for that field:What did you see instead?
The
Tree
is only updated afterExecute
is called.The text was updated successfully, but these errors were encountered: