Created
January 20, 2025 03:30
-
-
Save thuanpham582002/872aaae50ffb5e6cd1846a9d72823c9b to your computer and use it in GitHub Desktop.
Auto convert tpl value to string. I called it is nested go template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ if regexMatch "^[0-9]+$" (tpl (printf "%v" $val) $) }}{{ tpl (printf "%v" $val) $ }}{{ else }}{{ tpl (printf "%v" $val) $ | quote }}{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment