title: PANIC=runtime error: index out of range
body: <p>I have the following code, but i can't figure out why the error:<code>PANIC=runtime error: index out of range is happening</code></p>
  
  <pre><code>type Board struct {
      Tboard  [9]string
      Player1 Player
      Player2 Player
  }
  func makeBoard() *Board {
      b := &amp;Board{Tboard: [9]string{}}
      for x := 0; x &lt; len(b.Tboard); x++ {
          b.Tboard[x] = E // E = "[ ]"
          fmt.Println(b.Tboard[x])
      }
      fmt.Println(len(b.Tboard)) // =&gt; 9
      fmt.Print("Error: ")
      fmt.Println(b)        // =&gt; Error: %!v(PANIC=runtime error: index out of range)
      fmt.Println(b.Tboard) // =&gt; [[ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]]
      return b
  }
  </code></pre>