Hi! I’m new with Golang and a have a simple question: Can I populate a HTML template with a slice with variable size?
If I have:
type Data struct {
Example []string
}
Assuming that I am already using html/template
, Can I use the {{range pipeline}}
or something like this to iterate through this slice?
Thanks!
Souce: https://golang.org/pkg/text/template/
Update: I solved this problem using the {{range pipeline}}
, just read the documentation with more attention. Thanks!