1
0
mirror of https://github.com/golang/go synced 2024-10-03 21:11:22 -06:00
go/src/cmd/vet
Josh Bleecher Snyder eb6ae3ca7b cmd/vet/all: remove cmd/compile/internal/big special case
It no longer exists as of CL 31010.

Change-Id: Idd61f392544cad8b3f3f8d984dc5c953b473e2e5
Reviewed-on: https://go-review.googlesource.com/31934
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-10-25 14:59:27 +00:00
..
all cmd/vet/all: remove cmd/compile/internal/big special case 2016-10-25 14:59:27 +00:00
internal cmd/vet/internal/cfg: don't crash on malformed goto statement 2016-06-22 17:09:26 +00:00
testdata cmd/vet: cgo: emit no error for calls to C.CBytes 2016-10-24 19:05:50 +00:00
asmdecl.go cmd/vet: handle multiple arches in asm build directives 2016-08-22 15:43:16 +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 cmd/vet: check for copying of array of locks 2016-08-29 21:56:31 +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: check for duplicate json, xml struct field tags 2016-10-13 02:08:58 +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 cmd/vet: polish output of shadow test 2016-03-02 00:49:39 +00:00
shift.go cmd/vet: allow large shifts of constants 2016-08-18 23:39:37 +00:00
structtag.go cmd/vet: check for duplicate json, xml struct field tags 2016-10-13 02:08:58 +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 all: use testing.GoToolPath instead of "go" 2016-08-30 22:49:11 +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.