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
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
What did you do?
template.Must(template.New("test").Funcs(newTempFuncs).ParseFiles("test.temp"))
will do nothing, seems that parsefiles does not suport funcs;
template.Must(template.New("test").Funcs(newTempFuncs).Parse(templatetest))
the templatetest has the some content as test.temp and works as expect...
if i change template.Must(template.New("test").Funcs(newTempFuncs).ParseFiles("test.temp")); to template.Must(template.ParseFiles("test.temp")) and remove funcs in tempfile, everythings seems fine...so I am confused...
What did you expect to see?
template.Must(template.New("test").Funcs(newTempFuncs).ParseFiles("test.temp"))
should render template
What did you see instead?
do nothing until i change to template.Must(template.ParseFiles("test.temp")) and work as expect
The text was updated successfully, but these errors were encountered:
.......
tmpl1 := template.Must(template.New("foo.tmpl").Funcs(template.FuncMap{"trim": strings.TrimSpace,}).ParseFiles("foo.tmpl")) worked.... new must use filename...
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
template.Must(template.New("test").Funcs(newTempFuncs).ParseFiles("test.temp"))
will do nothing, seems that parsefiles does not suport funcs;
template.Must(template.New("test").Funcs(newTempFuncs).Parse(templatetest))
the templatetest has the some content as test.temp and works as expect...
if i change
template.Must(template.New("test").Funcs(newTempFuncs).ParseFiles("test.temp"));
totemplate.Must(template.ParseFiles("test.temp"))
and remove funcs in tempfile, everythings seems fine...so I am confused...What did you expect to see?
template.Must(template.New("test").Funcs(newTempFuncs).ParseFiles("test.temp"))
should render template
What did you see instead?
do nothing until i change to template.Must(template.ParseFiles("test.temp")) and work as expect
The text was updated successfully, but these errors were encountered: