We can access the index by this way :
{{- range $i, $s := (some list) }}
{{$i}}
{{-end }}
output:
0
1
..etc
However when the list is a result of a string split, the index becomes prefixed with an underscore
{{- range $i, $s := (split "X" "aaXbbXcc") }}
{{$i}}
{{-end }}
output:
_0
_1
..etc
why?