Thanks, I got it. On Friday, November 3, 2017 at 11:26:31 AM UTC+8, Jesse McNelis wrote: > > On Thu, Nov 2, 2017 at 4:54 PM, sheepbao <listo...@gmail.com <javascript:>> > 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.