On 09/12/2016 03:01 AM, Sagar P. wrote:
Ah, I see my mistake. Removed default to avoid a busy-loop.

Thanks!

Without `default` you need hot `for` and `select` at all. Just
    _ = <-channel:
    fmt.Println("Go routine has ended")
     os.Exit(0)
would be enough. In real situations however `default` most likely be an essence. CPU load is a cost of `select` which is quite expensive operation.

__
Ilya Kostarev

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to