My solution: https://play.golang.org/p/f5H0svLFE0
What do you think ?

Le mardi 5 juillet 2016 15:30:38 UTC+2, Jan Mercl a écrit :
>
>
> On Tue, Jul 5, 2016 at 11:38 AM Pierre Durand <pierre...@gmail.com 
> <javascript:>> wrote:
>
> > It works as expected, but in my real code, I'd prefer to avoid mutex.
>
> Sounds like a case for using a writer goroutine and sending it the 
> should-be-atomic log items via a chan string or chan []byte.
>
>
>
> -- 
>
> -j
>

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