What about type embedding? If put a sync.Mutex in a struct, that struct can 
not be embedded into another struct, right?

So I guess it's better idea to use structs with pointer to mutex.

On Friday, April 8, 2016 at 12:04:05 PM UTC+8, Andrew Gerrand wrote:
>
> It's fine to put a sync.Mutex in a struct—it's a common thing to do—just 
> be mindful not to copy the struct (pass a pointer instead).
>

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