Go Lang Notes


Templates What are they

using range to iterate over a map, array etc inside an HTML template.

You can loop over a map or array inside an HTML template by using range.

{{ range $key, $value := .News}}
  <p>some stuff</p>

{{ end }}