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
name: \"name\" is an incomplete or empty template"
What did you expect to see?
Execute() should execute as expected.
Instead, I had to change template.New(name).ParseFiles(file) to template.ParseFiles(file)
I therefore suggest:
The preferred option would be chaining template.New(name).ParseFiles(file) works, as reasonably expected
It errors out if chained
The present situation is unacceptable because you do not discover the problem until Execute() time and when you do, the error message is not helpful in diagnosing the cause.
The text was updated successfully, but these errors were encountered:
It works when name == file (t, err := template.New("test.tmpl").ParseFiles("test.tmpl")) and fails when not (t, err := template.New("test").ParseFiles("test.tmpl"))
Go version
1.22
Output of
go env
in your module/workspace:Not applicable for this
What did you do?
then elsewhere ...
What did you see happen?
On
Execute()
an error was raised:name: \"name\" is an incomplete or empty template"
What did you expect to see?
Execute()
should execute as expected.Instead, I had to change
template.New(name).ParseFiles(file)
totemplate.ParseFiles(file)
I therefore suggest:
template.New(name).ParseFiles(file)
works, as reasonably expectedThe present situation is unacceptable because you do not discover the problem until
Execute()
time and when you do, the error message is not helpful in diagnosing the cause.The text was updated successfully, but these errors were encountered: