Go templates: How do I access array item (arr[2]) in templates? -
how access array item (e.g. a[2]) in templates?
whenever "bad character u+005b '['"
{{ .a[2] }}
you need use index
template function.
{{index .a 2}}
how access array item (e.g. a[2]) in templates?
whenever "bad character u+005b '['"
{{ .a[2] }}
you need use index
template function.
{{index .a 2}}
Comments
Post a Comment