tools/cmd
Matt T. Proud a25a8d567b tools/cmd/vet: Create vet checks for examples.
In spite of https://blog.golang.org/examples and
http://golang.org/pkg/testing/#pkg-examples, a number of internal Go
authors have found writing documentation examples to be problematic in
the sense that the syntax is error-prone due to loose coupling with
identifiers found in the source corpus.

This commit introduces a suite of validations for documentation
examples:

    Overall:
    - Correct suffices, if present
    - Niladic function argument and return signatures

    func Example() {}
    func ExampleF() {}
    - F exists
    func ExampleT() {}
    - T exists
    func ExampleT_M() {}
    - T exists
    - M exists within T

Further, if the example is in `package foo_test`, vet attempts to
resolve the respective lookups in `package foo`, if `package foo`
exists (cf., `package stringutil_test`).

Change-Id: Ifa13906363541ebf28325681b749b14b7f8b103d
Reviewed-on: https://go-review.googlesource.com/11982
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-15 07:54:34 +00:00
..
benchcmp benchmark/parser, cmd/benchcmp: improve names of exported identifiers 2015-01-15 01:28:17 +00:00
callgraph go/ssa: rename some API features (incompatible change) 2015-08-31 22:20:12 +00:00
cover x/tools: disable tests not supported on Android 2015-08-06 00:36:03 +00:00
digraph tools: add import comments. 2014-12-09 22:42:16 +00:00
eg refactor/eg: refactor to break dependency on go/loader 2015-09-01 14:26:06 +00:00
fiximports cmd/fiximports: -replace flag specifies canonical packages in absence of import comments 2015-09-01 14:23:39 +00:00
godex tools: add import comments. 2014-12-09 22:42:16 +00:00
godoc godoc: fix source links for cmd/* 2015-09-11 00:20:26 +00:00
goimports goimports: create a var to permit custom implementations of flag parsing and 2015-03-27 18:14:11 +00:00
gomvpkg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gorename go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gotype cmd/gotype: keep gotype working with Go1.4 2015-08-25 03:53:50 +00:00
html2article all: address vet reports 2014-12-29 06:08:34 +00:00
oracle cmd/oracle: improve error messages 2015-05-13 15:02:11 +00:00
present cmd/present: fix mixed content warnings when served by HTTPS 2015-06-29 01:10:50 +00:00
ssadump go/ssa: rename some API features (incompatible change) 2015-08-31 22:20:12 +00:00
stress x/tools/cmd/stress: don't build for Plan 9 (syscall.SIGABRT not defined) 2015-07-31 22:56:17 +00:00
stringer cmd/stringer: exclude end-to-end test for Android 2015-08-05 22:44:14 +00:00
tipgodoc cmd/tipgodoc: change capitalization of 'Authors' to be consistent 2015-08-16 08:15:44 +00:00
vet tools/cmd/vet: Create vet checks for examples. 2015-09-15 07:54:34 +00:00