]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: make checking example names in _test packages more robust
authorKonstantin Shaposhnikov <k.shaposhnikov@gmail.com>
Mon, 27 Jun 2016 09:13:15 +0000 (17:13 +0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 28 Jun 2016 22:09:00 +0000 (22:09 +0000)
commit85a4f44745859ecdd71c034171d40263651f8594
treeede9b4b7655ef1be37411cf5b19ae9deb47855b8
parent733aefd06e5cf708637308a4ad7a048aa97db5cd
cmd/vet: make checking example names in _test packages more robust

Prior to this change package "foo" had to be installed in order to check
example names in "foo_test" package.

However by the time "foo_test" package is checked a parsed "foo" package
has been already constructed. Use it to check example names.

Also change TestDivergentPackagesExamples test to pass directory of the
package to the vet tool as it is the most common way to invoke it. This
requires changes to errchk to add support for grabbing source files from
a directory.

Fixes #16189

Change-Id: Ief103d07b024822282b86c24250835cc591793e8
Reviewed-on: https://go-review.googlesource.com/24488
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/vet/main.go
src/cmd/vet/testdata/divergent/buf_test.go
src/cmd/vet/tests.go
src/cmd/vet/vet_test.go
test/errchk