Or, if you have something else you’d rather be doing while waiting…

https://play.golang.org/p/rhwEpWMhqF

 

John

    John Souvestre - New Orleans LA

 

From: John Souvestre [mailto:j...@souvestre.com] 
Sent: 2016 September 13, Tue 16:21
To: 'golang-nuts@googlegroups.com'
Subject: RE: [go-nuts] Having difficulty testing this "cleanly"

 

OK.  Check this one out.  https://play.golang.org/p/kO_96oykG1

 

John

    John Souvestre - New Orleans LA

 

From: Evan Digby [mailto:evandi...@gmail.com] 
Sent: 2016 September 13, Tue 16:06
To: John Souvestre; golang-nuts@googlegroups.com
Subject: Re: [go-nuts] Having difficulty testing this "cleanly"

 

Hi John,

 

Thank you!

 

The h.closed channel, if checked properly (after the RLock), prevents the race 
condition that Augusto pointed out in his post a few back.

 

I fixed my implementation here: https://play.golang.org/p/QTkSJAOPtE

 

Thanks again,

 

Evan

 

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