1
0
mirror of https://github.com/golang/go synced 2024-10-04 17:11:21 -06:00
go/src/cmd/vet
Aliaksandr Valialkin dcc42c7d11 cmd/vet: do not check print-like functions with unknown type
Fixes #15787

Change-Id: I559ba886527b474dbdd44fe884c78973b3012377
Reviewed-on: https://go-review.googlesource.com/23351
Run-TryBot: Rob Pike <r@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2016-05-24 16:13:44 +00:00
..
internal/whitelist cmd/vet: improve checking unkeyed fields in composite literals 2016-04-28 13:51:40 +00:00
testdata cmd/vet: do not check print-like functions with unknown type 2016-05-24 16:13:44 +00:00
asmdecl.go cmd/vet: add mips64x assembly check support 2016-05-04 16:50:13 +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 all: single space after period. 2016-03-02 00:13:47 +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: allow lock types inside built-in new() 2016-03-30 00:16:48 +00:00
deadcode.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
doc.go cmd/vet: improve documentation for flags, slightly 2016-04-11 22:35:22 +00:00
main.go cmd/vet: improve documentation for flags, slightly 2016-04-11 22:35:22 +00:00
method.go all: single space after period. 2016-03-02 00:13:47 +00:00
nilfunc.go cmd/vet: adjust vet to use go/types and friends from std repo 2015-06-04 21:24:52 +00:00
print.go cmd/vet: do not check print-like functions with unknown type 2016-05-24 16:13:44 +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: adjust vet to use go/types and friends from std repo 2015-06-04 21:24:52 +00:00
structtag.go cmd: remove unnecessary type conversions 2016-04-15 02:32:10 +00:00
tests.go cmd/vet: add a check for tests with malformed names 2016-02-24 10:40:34 +00:00
types.go cmd/vet: improve checking unkeyed fields in composite literals 2016-04-28 13:51:40 +00:00
unsafeptr.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +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: fix test's dependence on perl 2016-05-03 23:59:56 +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.