cmd/vet: confuses C name with import "C" #20655
Closed
Comments
Looked at the code and this seems to be the case - only the |
CL https://golang.org/cl/45551 mentions this issue. |
As per golang.org/s/owners, CC @robpike @josharian |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: