Skip to content

Instantly share code, notes, and snippets.

@thuanpham582002
Created January 20, 2025 03:30
Show Gist options
  • Save thuanpham582002/872aaae50ffb5e6cd1846a9d72823c9b to your computer and use it in GitHub Desktop.
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
{{ 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