#Associating Locks with other Objects
6 messages · Page 1 of 1 (latest)
embedding them in structs is somewhat common, because you can then call Lock() and Unlock() on the struct value itself
you have to be careful to pass around the struct by pointer and not value if you do that
go vet (ran as part of go test) will tell you if you accidentally copy a mutex