http://stackoverflow.com/questions/16105325/how-to-check-a-channel-is-closed-or-not-without-reading-it
"So I think the best way to solve this is worker() close channel when
exits, if the controller finds a channel closed, it will jump over it and
do nothing. But I can't find how to check a channel is already closed or
not in this situation. If I try to read the channel in controller, the
controller might be blocked. So I'm very confused for now."
PS: Recovering the raised panic is what I have tried, but it will close
goroutine which raised panic. In this case it will be controller so it's no
use.
Still, I think it's useful for go team to implement this function in next
version of Go.
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.