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
I'm not sure if this is potentially a bug because I thought at one point the default was if you tried using a variable or param in a template that wasn't set without using an if statement, that it would error out. Now I just get empty values.
I understand that some people may want empty values, so I'm not going to argue what should be default. I'd really like the choice though to enforce non-empty values else error. I understand that I can check if something isn't set and use errorf but that is incredibly verbose (clogging up templates), prone to being overlooked and requires duplicative debugging.
Another request for when you don't want to change this setting site-wide would be to have a mandatory function. Basically, use case would be something like {{ .Description | mandatory }} or {{ mandatory .Keywords }}.
The text was updated successfully, but these errors were encountered:
I'm not sure if this is potentially a bug because I thought at one point the default was if you tried using a variable or param in a template that wasn't set without using an
if
statement, that it would error out. Now I just get empty values.I understand that some people may want empty values, so I'm not going to argue what should be default. I'd really like the choice though to enforce non-empty values else error. I understand that I can check if something isn't set and use
errorf
but that is incredibly verbose (clogging up templates), prone to being overlooked and requires duplicative debugging.Another request for when you don't want to change this setting site-wide would be to have a
mandatory
function. Basically, use case would be something like{{ .Description | mandatory }}
or{{ mandatory .Keywords }}
.The text was updated successfully, but these errors were encountered: