title: Confusion when appending to slice
body: <p>Can someone explain why in the first example if appending to y changes also x but in the second example it doesnt?</p>
  <pre><code>    x := make([]int, 0, 4)
      x = append(x, 1, 2, 3, 4) //len(x)=4 and cap(x)=4
      y := x[:2]                //Len(y)=2 and cap(y)=4
  
      y = append(y, 30, 40)
  
      fmt.Println(&quot;x:&quot;, x)
      fmt.Println(&quot;y:&quot;, y)
  
      //x: [1 2 30 40]
      //y: [1 2 30 40]
  </code></pre>
  <pre><code>    x := make([]int, 0, 4)
      x = append(x, 1, 2, 3, 4) //len(x)=4 and cap(x)=4
      y := x[:2]                //Len(y)=2 and cap(y)=4
  
      y = append(y, 30, 40,50)
  
      fmt.Println(&quot;x:&quot;, x)
      fmt.Println(&quot;y:&quot;, y)
  
      //x: [1 2 3 4]
      //y: [1 2 30 40 50]
  </code></pre>
  <p>And how is this affected by the capacity? For example if I change the capacity to 5</p>
  <pre><code>x := make([]int, 0, 5)
  x = append(x, 1, 2, 3, 4) 
  y := x[:2]             
  
  y = append(y, 30, 40, 50)
  
  fmt.Println(&quot;x:&quot;, x)
  fmt.Println(&quot;y:&quot;, y)
  
  //x: [1 2 30 40]
  //y: [1 2 30 40 50]
  </code></pre>
  <p>then it seems to work but then I would assume that x also contains 50?</p>