[go-nuts] Second nested done case in a select statement

2017-10-01 Thread Tamás Gulácsi
done may happen before value arriving from valStream. -- 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,

[go-nuts] Second nested done case in a select statement

2017-10-01 Thread go-question
What is the purpose of the second nested <-done case in the code snippet below? Wouldn't the first <-done case handle the cancellation? orDone := func(done, c <-chan interface{}) <-chan interface{} { valStream := make(chan interface{}) go func() { defer close(valStream) for { select { case