title: Passing an array as an argument in golang
body: <p>Why does this not work?</p>
  
  <pre><code>package main
  
  import "fmt"
  
  type name struct {
      X string
  }
  
  func main() {
      var a [3]name
      a[0] = name{"Abbed"}
      a[1] = name{"Ahmad"}
      a[2] = name{"Ghassan"}
  
      nameReader(a)
  } 
  
  func nameReader(array []name) {
      for i := 0; i &lt; len(array); i++ {
          fmt.Println(array[i].X)
      }
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>.\structtest.go:15: cannot use a (type [3]name) as type []name in function argument
  </code></pre>