title: Does Go have no real way to shrink a slice? Is that an issue?
body: <p>I've been trying out Go for some time and this question keeps bugging me. Say I build up a somewhat large dataset in a slice (say, 10 million int64s). </p>
  
  <pre><code>package main
  
  import (
      "math"
      "fmt"
  )
  
  func main() {
      var a []int64
      var i int64;
      upto := int64(math.Pow10(7))
      for i = 0; i &lt; upto; i++ {
          a = append(a, i)
      }
      fmt.Println(cap(a))
  }
  </code></pre>
  
  <p>But then I decide I don't want most of them so I want to end up with a slice of just 10 of those. I've tried both slicing and <a href="https://code.google.com/p/go-wiki/wiki/SliceTricks">delete techniques on Go's wiki</a> but none of them seem to reduce the slice's capacity.</p>
  
  <p>So that's my question: does Go has no real way of shrinking the capacity of a slice that would be similar to <code>realloc()</code>-ing with a smaller size argument than in your previous call on the same pointer in C? Is that an issue and how should one deal with it?</p>