title: In a Go slice, why does s[lo:hi] end at element hi-1?
body: <p>According to the <a href="http://tour.golang.org/#33" rel="noreferrer">Tour of Go</a>, in a Go slice <code>s</code>, the expression <code>s[lo:hi]</code> evaluates to a slice of the elements from <code>lo</code> through <code>hi-1</code>, inclusive:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
  
      p := []int{0,  // slice position 0 
                 10, // slice position 1
                 20, // slice position 2
                 30, // slice position 3
                 40, // slice position 4
                 50} // slice position 5
  
      fmt.Println(p[0:3]) // =&gt; [0 10 20]
  }    
  </code></pre>
  
  <p>In my code example above, "p[0:3]" would seem to intuitively "read" as: "the slice from position 0 to position 3", equating to [0, 10, 20, 30].  But of course, it actually equates to [0 10 20].</p>
  
  <p>So my question is: what is the design rationale for the upper value evaluating to <code>hi-1</code> rather than simply <code>hi</code>?  It feels unintuitive, but there must be some reason for it that I'm missing, and I'm curious what that might be.</p>
  
  <p>Thanks in advance.</p>