title: Golang append an item to a slice
body: <p>Why does the slice <code>a</code> remain the same? Does <code>append()</code> generate a new slice?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  var a = make([]int, 7, 8)
  
  func Test(slice []int) {
      slice = append(slice, 100)
      fmt.Println(slice)
  }
  
  func main() {
      for i := 0; i &lt; 7; i++ {
          a[i] = i
      }
  
      Test(a)
      fmt.Println(a)
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[0 1 2 3 4 5 6 100]
  [0 1 2 3 4 5 6]
  </code></pre>