Std
The Std registry provides a set of standard functions for common tasks, included by default, making it easy to perform basic operations without additional setup.
hello
{{ hello }} // Output: Hello!default
{{ .Nil | default "default" }} // Output: default
{{ "" | default "default" }} // Output: default
{{ "first" | default "default" }} // Output: first
{{ "first" | default "default" "second" }} // Output: secondempty
{{ .Nil | empty }} // Output: true
{{ "" | empty }} // Output: true
{{ 0 | empty }} // Output: true
{{ false | empty }} // Output: true
{{ .Struct | empty }} // Output: falseall
any
coalesce
ternary
cat
Last updated