cmd/vet: go1.7 not finding ExampleT_M identifiers #16189
go version go1.7beta2 linux/amd64
In https://github.com/google/go-github we have Travis builds on Go versions
You can reproduce the error by typing:
$ go get github.com/google/go-github $ cd $GOPATH/src/github.com/google/go-github $ go tool vet -v .
See above. Note that type
We are tracking this issue here if you would like to comment:
The text was updated successfully, but these errors were encountered:
The naming convention to declare examples for a package has not changed in 1.7, as can be confirmed here:
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:
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 <email@example.com> Run-TryBot: Rob Pike <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Rob Pike <firstname.lastname@example.org>