-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/vet: go1.7 not finding ExampleT_M identifiers #16189
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
Comments
The naming convention to declare examples for a package has not changed in 1.7, as can be confirmed here: https://github.com/golang/go/blob/go1.7beta2/src/testing/testing.go#L100-L115 So this indeed appears to be a bug/regression, rather than a valid change in behavior. (Either that, or the documentation/specification was not updated to match new vet behavior.) |
I have submitted CL 24487 that fixes the bug. Note however that you have to run While looking into this bug I also discovered that the test for this use case (examples in _test package) seems to be wrong however it is not easy to fix because:
|
CL https://golang.org/cl/24487 mentions this issue. |
A more complete fix in CL 24488. It might be too big for 1.7 though. |
CL https://golang.org/cl/24488 mentions this issue. |
This fixes the obvious bug and makes go vet look for identifiers in foo package when checking example names in foo_test package. Note that for this check to work the foo package have to be installed (using go install). This commit however doesn't fix TestDivergentPackagesExamples test that is not implemented correctly and passes only by chance. Updates #16189 Change-Id: I5c2f675cd07e5b66cf0432b2b3e422ab45c3dedd Reviewed-on: https://go-review.googlesource.com/24487 Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com> Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
go version go1.7beta2 linux/amd64
In https://github.com/google/go-github we have Travis builds on Go versions
1.4.3
,1.5.4
,1.6.2
, andtip
.tip
recently started failing with thego tool vet .
command. See: https://travis-ci.org/google/go-github/builds/140438111 and https://travis-ci.org/google/go-github/jobs/140438114 for more details.I ran
go tool vet -v .
locally, and get:You can reproduce the error by typing:
No errors.
See above. Note that type
Client
is defined ingithub.go
and methodMarkdown
is defined inmisc.go
.We are tracking this issue here if you would like to comment:
google/go-github#386
Thank you!
The text was updated successfully, but these errors were encountered: