Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
How to iterate over map keys in template?
7,518 views
Skip to first unread message
John Barham
unread,
Jun 2, 2012, 1:49:09 AM
6/2/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
The template action {{range m}} iterates over a map m's values, but is
it possible to iterate over its key?
John
David Symonds
unread,
Jun 2, 2012, 2:01:11 AM
6/2/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to John Barham, golang-nuts
On Sat, Jun 2, 2012 at 3:49 PM, John Barham <
jba...@gmail.com
> wrote:
> The template action {{range m}} iterates over a map m's values, but is
> it possible to iterate over its key?
Sure. Look at
http://golang.org/pkg/text/template/
, under "Variables".
Dave.
Reply all
Reply to author
Forward
0 new messages