title: goroutines order of execution
body: <p>I'm trying to understand this piece of code, not sure why the 2nd go is executed before the 1st one. It'd be great if someone can really help me out with this!</p>
  
  <pre><code>func sum(a []int, c chan int) {
     fmt.Println("summing: ", a)
     total := 0
     for _, v := range a {
        total += v
     }
     //fmt.Println("send to c",total)
     c &lt;- total  // send total to c
  }
  func main() {
      //a := []int{7, 2, 8,134,23,23,1,23,1234,143, -9, 4, 0, 1234}
  
      c := make(chan int)
  
      go sum([]int{1,2,3}, c)
      go sum([]int{4,5,6}, c)
  
      x := &lt;-c
      fmt.Println(x)
      x = &lt;-c
      fmt.Println(x)
  }
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>summing:  [4 5 6]
  15
  summing:  [1 2 3]
  6
  </code></pre>