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
Second, the new {{block}} action, combined with allowing redefinition of named templates, provides a ...
(Emphasis mine.)
However, when I read documentation for text/template package, it does not seem to say that it's possible to redefine templates. It mentions this ability in passing, as part of documenting the block action:
The typical use is to define a set of root templates that are
then customized by redefining the block templates within.
However, it does not explicitly say anywhere that "it's possible to redefine a named template", nor does it discuss any limitations in doing so.
This may be an issue that can be resolved with a single sentence like "It's possible to redefine a template by defining it again."
This may also be a non-issue if we consider that the ability to redefine templates can be understood to be implicit (i.e., if template redefinition is not explicitly said to be disallowed, then it must be allowed).
Templates may now be redefined,
but in the html/template package they may only be redefined before
the template is executed (and therefore escaped).
The intention is that such inline templates can be redefined by
subsequent template definitions, permitting a kind of template
"inheritance" or "overlay". (See the example for details.)
I think mentioning that in the text/template docs would potentially resolve this issue, if it's an issue.
The text was updated successfully, but these errors were encountered:
This may be an issue in context of #16913. Without this feature being explicitly documented, I found it hard to know whether that odd behavior was intentional or a bug.
I believe it may be an issue that template redefinition is not documented.
I only know it's possible to do so because Go 1.6 release notes mentioned it:
(Emphasis mine.)
However, when I read documentation for text/template package, it does not seem to say that it's possible to redefine templates. It mentions this ability in passing, as part of documenting the block action:
However, it does not explicitly say anywhere that "it's possible to redefine a named template", nor does it discuss any limitations in doing so.
This may be an issue that can be resolved with a single sentence like "It's possible to redefine a template by defining it again."
This may also be a non-issue if we consider that the ability to redefine templates can be understood to be implicit (i.e., if template redefinition is not explicitly said to be disallowed, then it must be allowed).
Related to #3812 and CL that implements this https://go-review.googlesource.com/#/c/14005/. Its commit message did document this:
I think mentioning that in the text/template docs would potentially resolve this issue, if it's an issue.
The text was updated successfully, but these errors were encountered: