It is better to ask this question with an example:
First, lets declare a variable in Golang:
{{ $html := "<b>hi!</b>" }}
If we try to output {{ $html }}
the output would be:
input:{{ $html }}
output:<b>hi!</b>
If you pass the safeHTML
function, the html will evaluate and the output would be:
input:{{ $html | safeHTML }}
output:hi!
Is there a way to parse a Golang variable? Like this:
If I try this:{{ $var1 := "it's me!" }}
{{ $var2 := "hey guys, {{ $var1 }}" }}
This would happen:
input:{{ $var2 }}
output:"hey guys, {{ $var 1 }}"
But I want the $var1
value to be evaluated, like this:"hey guys, it's me!"
Sorry if I wasn't clear enough, I'm not a native english speaker
Thanks for the help!