I am trying to display a list of comma separated values, and don't want to display a comma after the last item (or the only item if there is only one).
My code so far:
Equipment:
{{$equipment := .Equipment}}
{{ range $index, $element := .Equipment}}
{{$element.Name}}
{{if lt $index ((len $equipment) -1)}}
,
{{end}}
{{end}}
The current output: Equipment: Mat , Dumbbell ,
How do I get rid of the trailing comma