Skip to content

Commit

Permalink
enable also non hermetic functions
Browse files Browse the repository at this point in the history
Non hermetic functions are defined as "impure" functions. The list is
available here: https://github.com/Masterminds/sprig/blob/581758eb7d96ae4d113649668fa96acc74d46e7f/functions.go#L70

We enable them mainly due to date related functions that are very
beneficial to template developers.
  • Loading branch information
endorama committed Feb 14, 2023
1 parent 0bb19eb commit f96857f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/genlib/generator_with_text_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewGeneratorWithTextTemplate(tpl []byte, cfg Config, fields Fields) (*Gener

state := NewGenState()

templateFns := sprig.HermeticTxtFuncMap()
templateFns := sprig.TxtFuncMap()

templateFns["timeDuration"] = func(duration int64) time.Duration {
return time.Duration(duration)
Expand Down

0 comments on commit f96857f

Please sign in to comment.