diff options
author | Phillip Johnsen <johphi@gmail.com> | 2018-06-27T21·37+0200 |
---|---|---|
committer | Vincent Ambo <github@tazj.in> | 2018-07-14T21·21+0200 |
commit | ab059ad41c7195e5c4a3f456b7f590d881884dcf (patch) | |
tree | 63b0b512b747a135c3f1565b922c2a85970c19b8 /templater/templater_test.go | |
parent | 6b39254917a89a854060aac5a87ad88a6d4831fa (diff) |
feat(templater): override sprig default function with guarded alternative
These changes overrides the `default` function provided by sprig with an alternative to retrieve variable values from variables that might not have been declared at all. Referencing a variable in a template that is not declared, will lead to the underlying templating functionality raising an error, causing kontemplate to exit. The override alternative to `default` accepts a second string argument with the variable name. If the variable in question has not been declared the first argument's value would be returned, just as the original `default` function does.
Diffstat (limited to 'templater/templater_test.go')
0 files changed, 0 insertions, 0 deletions