title: Go: range and len of multidimensional array?
body: <p>Is it possible to use range and len on a multidimensional array?</p>
  
  <p>Either with var a [3]int8 or </p>
  
  <pre><code>package main
  
  func main () {    
          var a [3][5]int8
  
          for h := range a {
                  println(h)
          }
          println(len(a))
  }
  </code></pre>
  
  <p>Both produce
  <code>
  0
  1
  2
  3
  </code>
  ?</p>
  
  <p>Thanks to dystroy's answer, here's an example of writing and reading a 3-dimensional array i was able to adapt (posting here because I had much trouble finding any examples of this, so maybe this will help someone else):</p>
  
  <pre><code>package main
  func main() {
      var a [3][5][7]uint8
  
      //write values to array
      for x, b := range a {
          for y, c := range b {
              for z, _ := range c {
                      a[x][y][z] = uint8(x*100+y*10+z)
                  }
          }   
      }
  
      //read values from array
      for _, h := range a {
          for _, i := range h {
              for _, j := range i {
                  print(j, "\t")
              }
              println()
          }
          println()
      }
  
  }
  </code></pre>