How to use an if condition within a range iteration loop in go?
package main
import "os"
import "text/template"
const t = `{{range $i, $v := .}}{{$i}} {{$v}}{{if $i gt 0}}, {{end}}
{{end}}
`
func main() {
d := []string{"a", "b", "c"}
template.Must(template.New("").Parse(t)).Execute(os.Stdout, d)
}