title: Big O of append in Golang
body: <p>What is the complexity of Go's builtin <code>append</code> function? What about string concatenation using <code>+</code>?</p>
  
  <p>I'd like to remove an element from a slice by appending two slices excluding that element, ex. <a href="http://play.golang.org/p/RIR5fXq-Sf" rel="nofollow noreferrer">http://play.golang.org/p/RIR5fXq-Sf</a></p>
  
  <pre><code>nums := []int{0, 1, 2, 3, 4, 5, 6, 7}
  fmt.Println(append(nums[:4], nums[5:]...))
  
  =&gt; [0 1 2 3 5 6 7]
  </code></pre>
  
  <p><a href="http://golang.org/pkg/builtin/#append" rel="nofollow noreferrer">http://golang.org/pkg/builtin/#append</a> says that if the destination has sufficient capacity, then that slice is <code>resliced</code>. I'm hoping that "reslicing" is a constant time operation. I'm also hoping the same applies to string concatenation using <code>+</code>.</p>