title: Panic: runtime error: index out of range
body: <p>Sorry if this seems pretty basic but why am I getting this error? I dont see any slices/arrays out of range.</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main(){
      s:= [...]int{1,2,3}
      rev(s[:])
      fmt.Println(s)
  }
  
  func rev(input []int) []int {
      var j int
      l:=len(input)-1
      for i:=0; i&lt;l;i++ {
          j= input[len(input)-i]
          input=append(input, j)
          i++
      }
      return input[:l]
  }
  </code></pre>
  
  <p>Thanks</p>