You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Templating YAML is tedious and error prone, but we can make it less so by introducing the Sprig library (github.com/Masterminds/sprig).
For example, our embedded YAML templates currently have a meaningful number of space characters carefully placed to render with proper indentation. With Sprig, we can instead say "print this string at indentation level 2."
Before:
// note the invisible two spaces preceding "listeners:"
{{ if .Router.IsPrivate }}#{{ end }} listeners:
After:
{{ if .Router.IsPrivate }}#{{ end }}{{-"listeners:"|nindent2 }}
The text was updated successfully, but these errors were encountered:
personally, i don't see the need for another dependency for this. agree it's annoying but i'm fine with the annoyance to keep yet another dependency out of our code
Templating YAML is tedious and error prone, but we can make it less so by introducing the Sprig library (
github.com/Masterminds/sprig
).For example, our embedded YAML templates currently have a meaningful number of space characters carefully placed to render with proper indentation. With Sprig, we can instead say "print this string at indentation level 2."
Before:
After:
The text was updated successfully, but these errors were encountered: