1
0
mirror of https://github.com/golang/go synced 2024-11-18 10:54:40 -07:00
go/src/text
Rob Pike f9ed2f75c4 text/template: clarify the documentation around template definitions
Due to the requirements of parsing template definitions that mention
other templates that are not yet defined, a Template can be in two states:
defined and undefined. Thus, although one calls New, the resulting
template has no definition even though it exists as a data structure.

Thus, for example, will return nil for a template that is named but not
yet defined.

Fixes #10910
Fixes #10926

Clarify the documentation a little to explain this,
Also tidy up the code a little and remove a spurious call to init.

Change-Id: I22cc083291500bca424e83dc12807e0de7b00b7a
Reviewed-on: https://go-review.googlesource.com/10641
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-02 21:57:41 +00:00
..
scanner text/scanner: avoid further reads after EOF 2015-05-13 23:14:50 +00:00
tabwriter
template text/template: clarify the documentation around template definitions 2015-06-02 21:57:41 +00:00