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
No vet errors related to passing pointers to C (I'm not even doing import "C")
What did you see instead?
$ go vet f.go
f.go:9: possibly passing Go type with embedded pointer to C
exit status 1
Note that this happens when the variable is named exactly C, and when we use a method on the type that has a pointer somewhere.
My intuition is that vet here does not check what C stands for. Since it seems like cmd/vet has type information, it should be fairly easy to figure out when C actually comes from import "C" and when it does not.
Happy to work on a patch if my thinking is correct.
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
)?go version devel +0e9d293db7 Sun Jun 11 04:25:26 2017 +0000 linux/amd64
Also on 1.8.3.
What operating system and processor architecture are you using (
go env
)?Not relevant.
What did you do?
Run
go vet
on:https://play.golang.org/p/uObdj6peim
What did you expect to see?
No vet errors related to passing pointers to C (I'm not even doing
import "C"
)What did you see instead?
Note that this happens when the variable is named exactly
C
, and when we use a method on the type that has a pointer somewhere.My intuition is that
vet
here does not check whatC
stands for. Since it seems likecmd/vet
has type information, it should be fairly easy to figure out whenC
actually comes fromimport "C"
and when it does not.Happy to work on a patch if my thinking is correct.
The text was updated successfully, but these errors were encountered: