New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go vet complains about undefined methods, even though go test succeeds #26797
Comments
Thanks for reporting the bug. I can reproduce this with 1.10 but not with 1.11beta3. So I assume this is fixed in the upcoming 1.11 release. This isn't something we will fix on the release branch, so closing this issue. |
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
There is bug in go that even tests pass, vet complains about undefined methods. And they only fixed it in go 1.11. golang/go#26797
I see this issue for go 1.12.
|
Anyone know how to fix this, I'm on |
given the recent reports starting on March 5th of this being re-introduced in 1.12, this issue should be re-opened, or a new one created. |
Any update on this. This just happened to me. I am using go1.11.5 darwin/amd64. GOVET fails with undefined: <struct_name> when calling an struct from the same package that is in a different file. |
for me, I had to update separate tooling my organization uses, which itself depends on go. So I am assuming in my case that there was some non-obvious conflict between the go version on my system and the go version my tooling was using. |
This is still happening to me on |
why was this closed, till today I can reproduce with go1.12.6, why |
Reopening to see if it still occurs. For people reporting it: does it occur with the original test case? |
@tx0c, I can't reproduce this issue with
|
What version of Go are you using (
go version
)?1.10.3
Does this issue reproduce with the latest release?
Yes, 1.10.3 is the latest release.
What operating system and processor architecture are you using (
go env
)?What did you do?
Made
go vet
complain about an undefined method, even thoughgo test
works fine.Repro in: https://github.com/prashantv/govet-bug
What makes this case tricky is that:
registry_utils_test.go
is a test file that exports an unexported methodregistry_test.go
is trying to call the exported method through an external type that embeds the originalRegistry
.If I import the
registry
package, then the error goes away.What did you expect to see?
go vet
to not complain about a missing field/method, sincego test
passes, and the method should be promoted fromregistry.Registry
toregistrytest.Registry
.What did you see instead?
The error as reported earlier,
In a larger codebase internally,
go vet
crashed,The text was updated successfully, but these errors were encountered: