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
This is potentially related to #16912. I couldn't really find explicit documentation on template redefinition, and any limitations/restrictions on it.
From looking around the CL that implemented it and its commit message, it made it sound like it should be possible to simply redefine any template by defining it again, and then have it take on the new template content.
In other words, I expected a template redefined to new content X to behave as if it were a template first created with content X. This turned out not to be the case for some content X (so far, it happens when content is empty or contains whitespace and template comments only).
What version of Go are you using (go version)?
go version devel +2f679d7 Sun Aug 28 21:38:09 2016 +0000 linux/amd64
(That's the latest tip commit 2f679d7 from a day ago as of posting this.)
I initially ran into this issue on Go 1.7, but I tried it on latest tip in order to check if it has since been fixed or not. It's not.
What operating system and processor architecture are you using (go env)?
This is potentially related to #16912. I couldn't really find explicit documentation on template redefinition, and any limitations/restrictions on it.
From looking around the CL that implemented it and its commit message, it made it sound like it should be possible to simply redefine any template by defining it again, and then have it take on the new template content.
In other words, I expected a template redefined to new content X to behave as if it were a template first created with content X. This turned out not to be the case for some content X (so far, it happens when content is empty or contains whitespace and template comments only).
What version of Go are you using (
go version
)?(That's the latest
tip
commit 2f679d7 from a day ago as of posting this.)I initially ran into this issue on Go 1.7, but I tried it on latest
tip
in order to check if it has since been fixed or not. It's not.What operating system and processor architecture are you using (
go env
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I redefined a template with an empty template, or a template consisting of whitespace (and template comments).
https://play.golang.org/p/c3K-zyJ4dd
What did you expect to see?
What did you see instead?
The template redefinition was effectively ignored. No error, and the old template contents were still used.
If you include any non-whitespace character in the redefined template content, such as
x
, then it works as expected, e.g.:The text was updated successfully, but these errors were encountered: