What would be the correct syntax for defining an array variable inside the go template? (here is the HTML template). Here is what I tried:
{{define "template"}} {{ $x:=[]int{0,1,2} }}{{$x[0]}} {{end}}
The error log says: unexpected "[" in command
Thanks.
variables arrays go templates
Nicolas marshall
source share