On Fri, May 5, 2017 at 1:35 PM, Ronald <
yunth...@gmail.com> wrote:
>
> So the question:
>
> Isn't it better just to throw a panic when user send/recv on a nil
> channel instead of forever blocking it? If not, what is the benefits?
There is value in the ability to have a select case be a nil channel.
In a select a nil channel is never ready to receive and thus isn't a
case that will proceed.
This is useful for allowing you to conditionally prevent certain cases
from proceeding by swapping out the channel for a nil.
While outside a select this behaviour isn't really useful, but for
consistency it works exactly the same.