On Thu, Nov 2, 2017 at 4:54 PM, sheepbao <listome...@gmail.com> wrote:
>
> the close function is thread safety? how about call `closed` at the same
> time.

It's not safe. Multiple goroutines can enter the 'default'  case in
that select and close() the channel multiple times.

"Sending to or closing a closed channel causes a run-time panic."
https://golang.org/ref/spec#Close

-- 
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