title: throw: all goroutines are asleep - deadlock
body: <p>Given the following simple Go program</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  func total(ch chan int) {
      res := 0
      for iter := range ch {
          res += iter
      }
      ch &lt;- res
  }
  
  func main() {
      ch := make(chan int)
      go total(ch)
      ch &lt;- 1
      ch &lt;- 2
      ch &lt;- 3
      fmt.Println("Total is ", &lt;-ch)
  }
  </code></pre>
  
  <p>I am wondering if someone can enlighten me as to why I get</p>
  
  <pre><code>throw: all goroutines are asleep - deadlock!
  </code></pre>
  
  <p>thank you</p>