diff --git a/template/html/option.go b/template/html/option.go index 31df3e3..988fa3a 100644 --- a/template/html/option.go +++ b/template/html/option.go @@ -33,6 +33,9 @@ func WithDefaultHelpers() OptionFunc { // to expose the default helpers func WithHelper(name string, fn interface{}) OptionFunc { return func(opts *Options) { + if opts.Helpers == nil { + opts.Helpers = make(template.FuncMap) + } opts.Helpers[name] = fn } }