title: Concatenate two slices in Go
body: <p>I'm trying to combine the slice <code>[1, 2]</code> and the slice <code>[3, 4]</code>. How can I do this in Go?</p>
  
  <p>I tried:</p>
  
  <pre><code>append([]int{1,2}, []int{3,4})
  </code></pre>
  
  <p>but got:</p>
  
  <pre><code>cannot use []int literal (type []int) as type int in append
  </code></pre>
  
  <p>However, <a href="http://golang.org/pkg/builtin/#append">the documentation</a> seems to indicate this is possible, what am I missing?</p>
  
  <pre><code>slice = append(slice, anotherSlice...)
  </code></pre>