title: Go Lang Print Inputted Array
body: <p>I am studying Go lang right now and I encountered a problem when trying to print inputted Array. My code is like this:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  func main() {
      var n int
      fmt.Scan(&amp;n)
      set(n)
  }
  
  func set(n int) {
      a := make([]int, n)
      for i := 0; i &lt; n; i++ {
          fmt.Scan(&amp;a[i])
      }
      for y := 0; y &lt; n; y++ {
          fmt.Println(a[y])
      }
      return
  }
  </code></pre>
  
  <p>my problem is when Inputted a number as a size for the array, that number always get printed too.
  Like when I inputted 8 as the array size then followed by the array value for example 10 9 8 7 6 5 4 3 then I get the wrong output: 8 10 9 8 7 6 5 4.Iit should be 10 9 8 7 6 5 4 3.</p>