title: unexpected slice append behaviour
body: <p>I encountered weird behaviour in go code today: when I append <code>elements</code> to <code>slice</code> in loop and then try to create new <code>slices</code> based on the result of the loop, last <code>append</code> overrides <code>slices</code> from previous <code>appends</code>.</p>
  
  <p>In this particular example it means that <code>sliceFromLoop</code> <code>j</code>,<code>g</code> and <code>h</code> slice's last element are not <code>100</code>,<code>101</code> and <code>102</code> respectively, but...always <code>102</code>!</p>
  
  <p>Second example - <code>sliceFromLiteral</code> behaves as expected.</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func create(iterations int) []int {
      a := make([]int, 0)
      for i := 0; i &lt; iterations; i++ {
          a = append(a, i)
      }
      return a
  }
  
  func main() {
      sliceFromLoop()
      sliceFromLiteral()
  
  }
  
  func sliceFromLoop() {
      fmt.Printf("** NOT working as expected: **\n\n")
      i := create(11)
      fmt.Println("initial slice: ", i)
      j := append(i, 100)
      g := append(i, 101)
      h := append(i, 102)
      fmt.Printf("i: %v\nj: %v\ng: %v\nh:%v\n", i, j, g, h)
  }
  
  func sliceFromLiteral() {
      fmt.Printf("\n\n** working as expected: **\n")
      i := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
      fmt.Println("initial slice: ", i)
      j := append(i, 100)
      g := append(i, 101)
      h := append(i, 102)
      fmt.Printf("i: %v\nj: %v\ng: %v\nh:%v\n", i, j, g, h)
  }
  </code></pre>
  
  <p>link to play.golang:
  <a href="https://play.golang.org/p/INADVS3Ats" rel="noreferrer">https://play.golang.org/p/INADVS3Ats</a></p>
  
  <p>After some reading, digging and experimenting I found that this problem is originated in <code>slices</code> referencing the same underlaying <code>array</code>  values and can be solved by copying <code>slice</code> to new one before appending anything, however it looks quite... hesitantly.</p>
  
  <p><strong>What's the idomatic way for creating many new slices based on old ones and not worrying about changing values of old slices?</strong></p>