1
0
mirror of https://github.com/golang/go synced 2024-10-03 17:21:21 -06:00
go/src/cmd/vet
Robert Griesemer 26e43779f1 Revert "cmd/vet: teach vet about ast.AliasSpec"
This reverts commit aa8c8e770e.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: I4db9a8d6b3625c794be9d2f1ff0e9c047f383d28
Reviewed-on: https://go-review.googlesource.com/32827
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Manghane <cmang@golang.org>
2016-11-05 00:18:05 +00:00
..
all cmd/vet/all: add s390x support 2016-11-03 15:33:27 +00:00
internal cmd/vet/internal/cfg: don't crash on malformed goto statement 2016-06-22 17:09:26 +00:00
testdata Revert "cmd/vet: teach vet about ast.AliasSpec" 2016-11-05 00:18:05 +00:00
asmdecl.go cmd/vet: add support for GOARCH=mips{,le} 2016-11-04 18:26:49 +00:00
assign.go
atomic.go cmd/vet: do not treat declaration as asignment in atomic check 2016-04-06 16:38:24 +00:00
bool.go
buildtag.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo.go cmd/vet: cgo: emit no error for calls to C.CBytes 2016-10-24 19:05:50 +00:00
composite.go cmd/vet: improve checking unkeyed fields in composite literals 2016-04-28 13:51:40 +00:00
copylock.go Revert "cmd/vet: teach vet about ast.AliasSpec" 2016-11-05 00:18:05 +00:00
deadcode.go cmd/vet: -lostcancel: check for discarded result of context.WithCancel 2016-06-21 14:58:33 +00:00
doc.go cmd/vet: fix formatting of headings in doc.go. 2016-10-18 00:06:20 +00:00
lostcancel.go cmd/vet: lostcancel: treat naked return as a use of named results 2016-06-30 21:53:32 +00:00
main.go cmd/vet: accept space-separated tag lists for compatibility with cmd/go 2016-10-25 20:42:01 +00:00
method.go all: single space after period. 2016-03-02 00:13:47 +00:00
nilfunc.go
print.go cmd/vet: skip printf check for non-constant format string during failed import 2016-10-05 14:25:46 +00:00
rangeloop.go cmd/vet: don't treat fields like variables in rangeloop check 2016-03-27 05:31:54 +00:00
README cmd/vet: add a README explaining the criteria for new checks 2016-03-01 20:48:20 +00:00
shadow.go Revert "cmd/vet: teach vet about ast.AliasSpec" 2016-11-05 00:18:05 +00:00
shift.go cmd/vet: allow large shifts of constants 2016-08-18 23:39:37 +00:00
structtag.go cmd/vet: diagnose non-space-separated struct tag like json:"x",xml:"y" 2016-10-26 13:37:51 +00:00
tests.go cmd/vet: make checking example names in _test packages more robust 2016-06-28 22:09:00 +00:00
types.go cmd/vet: allow any printf verb with any interface 2016-08-18 02:01:25 +00:00
unsafeptr.go cmd/vet: allow ^& uintptr arithmetic 2016-08-17 20:48:57 +00:00
unused.go go/types: port recent x/tools/go/types fixes 2015-06-15 20:11:37 +00:00
vet_test.go cmd/vet: accept space-separated tag lists for compatibility with cmd/go 2016-10-25 20:42:01 +00:00

Vet is a tool that checks correctness of Go programs. It runs a suite of tests,
each tailored to check for a particular class of errors. Examples include incorrect
Printf format verbs or malformed build tags.

Over time many checks have been added to vet's suite, but many more have been
rejected as not appropriate for the tool. The criteria applied when selecting which
checks to add are:

Correctness:

Vet's tools are about correctness, not style. A vet check must identify real or
potential bugs that could cause incorrect compilation or execution. A check that
only identifies stylistic points or alternative correct approaches to a situation
is not acceptable.

Frequency:

Vet is run every day by many programmers, often as part of every compilation or
submission. The cost in execution time is considerable, especially in aggregate,
so checks must be likely enough to find real problems that they are worth the
overhead of the added check. A new check that finds only a handful of problems
across all existing programs, even if the problem is significant, is not worth
adding to the suite everyone runs daily.

Precision:

Most of vet's checks are heuristic and can generate both false positives (flagging
correct programs) and false negatives (not flagging incorrect ones). The rate of
both these failures must be very small. A check that is too noisy will be ignored
by the programmer overwhelmed by the output; a check that misses too many of the
cases it's looking for will give a false sense of security. Neither is acceptable.
A vet check must be accurate enough that everything it reports is worth examining,
and complete enough to encourage real confidence.