title: How to get the last element of a slice?
body: <p>What is the Go way for extracting the last element of a slice?</p>
  
  <pre><code>var slice []int
  
  slice = append(slice, 2)
  slice = append(slice, 7)
  
  slice[len(slice)-1:][0] // Retrieves the last element
  </code></pre>
  
  <p>The solution above works, but seems awkward.</p>