mirror of
https://github.com/golang/go.git
synced 2025-05-28 02:41:30 +00:00
Using a type containing a sync type directly in a function call (whether as a receiver, a param, or a return value) is an easy way to accidentally copy a lock or other sync primitive. Check for it. The test as implemented does not provide 100% coverage; see the discussion near the bottom of testdata/copylock.go for shortcomings. Fixes golang/go#6729. R=adg, r, dsymonds CC=golang-dev https://golang.org/cl/23420043