Skip to content

Commit

Permalink
fix(hz):Append content cannot use template's function (#999)
Browse files Browse the repository at this point in the history
  • Loading branch information
ypo2478 authored Nov 17, 2023
1 parent c849a7a commit 9c3f0b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/hz/generator/custom_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func renderImportTpl(tplInfo *Template, data interface{}) ([]string, error) {

// renderAppendContent used to render append content for 'update' command
func renderAppendContent(tplInfo *Template, renderInfo interface{}) (string, error) {
tpl, err := template.New(tplInfo.Path).Parse(tplInfo.UpdateBehavior.AppendTpl)
tpl, err := template.New(tplInfo.Path).Funcs(funcMap).Parse(tplInfo.UpdateBehavior.AppendTpl)
if err != nil {
return "", fmt.Errorf("parse append content template(%s) failed, err: %v", tplInfo.Path, err)
}
Expand Down

0 comments on commit 9c3f0b7

Please sign in to comment.