Golang http/template has substitution features, if
construction, but I didn't find for
construction. How can I iterate through a slice? Like this:
{{for x in xs}}
Hello, {{x.Name}}!
{{end}}
use range
{{range xs}}
Hello, {{.Name}}!
{{end}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With