We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As far as I can see, it is not possible to define additional Template functions. For example, the following code defines some functions:
if renderer.tmpl == nil { tmpl := template.New(name) tmpl.Funcs(map[string]interface{}{ "add": func(n1, n2 int) int { return n1 + n2 }, ...
but it would be great to be able to add others (such as the functions provided by Sprig for instance), when creating a new renderer (NewRenderer).
NewRenderer
The text was updated successfully, but these errors were encountered:
I can submit a PR if it can help. 😌 Just let me know.
Sorry, something went wrong.
I've put together a small change that adds a WithTemplateFunc option to the renderer. Let me know if that solves your issue
WithTemplateFunc
@princjef Great! That's perfect. Thanks. 👍
Successfully merging a pull request may close this issue.
As far as I can see, it is not possible to define additional Template functions. For example, the following code defines some functions:
but it would be great to be able to add others (such as the functions provided by Sprig for instance), when creating a new renderer (
NewRenderer
).The text was updated successfully, but these errors were encountered: