Tagging
Try bookmarklet. Easy tagging.
Do you want to delete?
Do you want to modify?
  • LINKTAG
  • New
  • Tag
  • Comment
  • Tag, ternary
Sign in

ternary

go template ternary operator

How can I conditionally set a variable in a Go template based on an expression which may cause an error if not wrapped with an if statement - Stack Overflow

Question How do I do something like this: {{ $use_ssl := (ne $.Env.CERT_NAME "") }} where $.Env.CERT_NAME may be nil/undefined. If it is nil, it gives this error: at <ne $.Env.CERT_NAME ""&g...
wono | discuss |
© 2025. LINKTAG.ORG. Help Feedback Privacy Terms