title: What's the Go idiom for Python's list.pop() method?
body: <p>In Python, I have the following:</p>
  
  <pre class="lang-python prettyprint-override"><code>i = series.index(s) # standard Python list.index() function
  tmp = series.pop(i)
  blah = f(tmp)
  series.append(tmp)
  </code></pre>
  
  <p>In converting this to Go, I am looking for a similar way of retrieving an item from a slice by index, doing something with it, then putting the original item at the end of my slice.</p>
  
  <p>From <a href="https://github.com/golang/go/wiki/SliceTricks" rel="noreferrer">here</a>, I have arrived at the following:</p>
  
  <pre><code>i = Index(series, s) // my custom index function...
  tmp, series = series[i], series[i+1:]
  blah := f(tmp)
  series = append(series, tmp)
  </code></pre>
  
  <p>But this fails at the end of lists:</p>
  
  <pre class="lang-none prettyprint-override"><code>panic: runtime error: slice bounds out of range
  </code></pre>
  
  <p>How would I idiomatically translate this <code>slice.pop()</code> into Go?</p>