text/template: document redefinition of templates #17360
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Go home page, Go 1.7.1.
Package
text/template
andhtml/template
provide the same interface. But the documentation oftext/template.Parse()
andhtml/template.Parse()
are different.text/template.Parse()
leaves out an important fact that it is an error to redefine a non-empty template.html/template.Parse()
contains this important fact. But they work the same way.I believe when
{{block}}
action was added in Go 1.6 and redefining of templates got allowed, only the doc ofhtml/template.Parse()
was updated but nottext/template.Parse()
.Example code that triggers this error:
Playground link with
text/template
: https://play.golang.org/p/PY3zLcCFiuPlayground link with
html/template
: https://play.golang.org/p/UeQk4D3tcBThe text was updated successfully, but these errors were encountered: