Go HTML templates: defining array of array of strings to range over
问题 In Jinja2 (Python Flask) templates, I'm able to create a static navigation menu by defining a list of tuples with code similar to the following: {% for item in [('', 'Home'), ('menu1', 'Menu1'), ('menu2', 'Menu2')] %} <li><a href="{% if item[0] == '' %}/{% else %}{{ '/%s/' % item[0] }}{% endif %}">{{ item[1] }}</a></li> {%- endfor %} I'd like to create something similar in Go HTML templates. I assume the equivalent to a list of tuples would be an array/slice of arrays of strings, i.e.,