mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-04 14:58:47 +00:00
template: add test for custom function
Signed-off-by: Tw <tw19881113@gmail.com>
This commit is contained in:
parent
f28a159b72
commit
790c842fad
4 changed files with 12 additions and 3 deletions
|
|
@ -264,8 +264,7 @@ func ContextInclude(filename string, ctx interface{}, fs http.FileSystem) (strin
|
|||
return "", err
|
||||
}
|
||||
|
||||
tpl := template.New(filename).Funcs(TemplateFuncs)
|
||||
tpl, err = tpl.Parse(string(body))
|
||||
tpl, err := template.New(filename).Funcs(TemplateFuncs).Parse(string(body))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue