cmd/vet: teach vet that putting a large value in an interface makes a copy #14529
Labels
Milestone
Comments
This would have caught some bugs for us. |
cc @valyala :) |
It looks like this is already fixed in #14664 (go tip):
|
Other cases must be checked such as passing lock as function argument accepting |
Prepared a CL, which expands copylock check to function calls and return values - see https://go-review.googlesource.com/20832 . This catches passing lock into |
CL https://golang.org/cl/20832 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
$ go vet x.go x.go:14: assignment copies lock value to s: main.T exit status 1
vet should also complain about the assignment
e = t
, since it also copies t's value.The text was updated successfully, but these errors were encountered: