1
0
mirror of https://github.com/golang/go synced 2024-11-08 18:46:16 -07:00
go/src/cmd/vet
Josh Bleecher Snyder 2f5aea7c13 Revert "Revert "cmd/vet/all: remove pprof from the whitelist""
This reverts commit 9bd1cc3fa1.

Reason for revert: New fixes in from upstream. Try this again.

Change-Id: Iea46f32857e8467f8d5a49b31e20a52fda8bce60
Reviewed-on: https://go-review.googlesource.com/37693
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-02 19:10:21 +00:00
..
all Revert "Revert "cmd/vet/all: remove pprof from the whitelist"" 2017-03-02 19:10:21 +00:00
internal
testdata cmd/vet: allow shifts by amounts calculated using unsafe 2017-02-28 19:13:18 +00:00
asmdecl.go cmd/vet: use types.SizesFor 2017-03-02 17:13:36 +00:00
assign.go
atomic.go
bool.go
buildtag.go
cgo.go cmd/vet: avoid crash in cgo test on recursive type 2016-12-21 04:29:31 +00:00
composite.go
copylock.go cmd/vet: include function name or value in copylock message 2017-01-03 19:23:23 +00:00
deadcode.go
doc.go cmd/vet: support importing from source 2017-03-02 18:43:23 +00:00
httpresponse.go cmd/vet: refactor to support alternative importers 2017-03-02 18:43:12 +00:00
lostcancel.go
main.go cmd/vet: support importing from source 2017-03-02 18:43:23 +00:00
method.go
nilfunc.go
print.go
rangeloop.go
README
shadow.go
shift.go cmd/vet: allow shifts by amounts calculated using unsafe 2017-02-28 19:13:18 +00:00
structtag.go cmd/vet: fix panic and handling of XML in struct field tag check 2016-12-13 03:13:24 +00:00
tests.go
types.go cmd/vet: support importing from source 2017-03-02 18:43:23 +00:00
unsafeptr.go
unused.go
vet_test.go cmd/vet: avoid crash in cgo test on recursive type 2016-12-21 04:29:31 +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.