You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ go vet ./test.go
test.go:10: call of unsafe.Sizeof copies lock value: sync.Mutex
exit status 1
What did you expect to see?
I would expect go vet to not report unsafe.Sizeof as an unsafe operation since it's resolved at compile time and therefore doesn't cause a copy. It should also return 0 in the program given as example.
What did you see instead?
go vet returns 1 to indicate a failure because it misinterpreted the call to unsafe.Sizeof as making a copy of a mutex.
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
go vet
gives a false positive when usingunsafe.Sizeof
on an expression that would copy async.Mutex
, here's a minimal example:What did you expect to see?
I would expect
go vet
to not reportunsafe.Sizeof
as an unsafe operation since it's resolved at compile time and therefore doesn't cause a copy. It should also return 0 in the program given as example.What did you see instead?
go vet
returns 1 to indicate a failure because it misinterpreted the call tounsafe.Sizeof
as making a copy of a mutex.The text was updated successfully, but these errors were encountered: