title: Iterating through map in template
body: <p>I am trying to display a list gym classes (Yoga, Pilates etc). For each class type there are several classes, so I want to group all the Yoga classes, and all the Pilates classes and so on.</p>
  
  <p>I made this function to take a slice and make a map of it</p>
  
  <pre><code>func groupClasses(classes []entities.Class) map[string][]entities.Class {
      classMap := make(map[string][]entities.Class)
      for _, class := range classes {
          classMap[class.ClassType.Name] = append(classMap[class.ClassType.Name], class)
      }
      return classMap
  }
  </code></pre>
  
  <p>The problem is now how can I iterate through it, according to <a href="http://golang.org/pkg/text/template/">http://golang.org/pkg/text/template/</a>, you need to access it in <code>.Key</code> format, I don't know the keys (unless I also passed a slice of keys into the template). How do I unpack this map in my view.</p>
  
  <p>All I have currently is </p>
  
  <pre><code>{{ . }} 
  </code></pre>
  
  <p>which displays something like:</p>
  
  <pre><code>map[Pilates:[{102 PILATES ~/mobifit/video/ocen.mpg 169 40 2014-05-03 23:12:12 +0000 UTC 2014-05-03 23:12:12 +0000 UTC 1899-12-30 00:00:00 +0000 UTC {PILATES Pilates 1 2014-01-22 21:46:16 +0000 UTC} {1 leebrooks0@gmail.com password SUPERADMIN Lee Brooks {Male true} {1990-07-11 00:00:00 +0000 UTC true} {1.85 true} {88 true} 2014-01-22 21:46:16 +0000 UTC {0001-01-01 00:00:00 +0000 UTC false} {0001-01-01 00:00:00 +0000 UTC false} {0001-01-01 00:00:00 +0000 UTC false}} [{1 Mat 2014-01-22 21:46:16 +0000 UTC}]} {70 PILATES ~/mobifit/video/ocen.mpg 119 66 2014-03-31 15:12:12 +0000 UTC 2014-03-31 15:12:12 +0000 UTC 1899-12-30 00:00:00 +0000 UTC 
  </code></pre>