• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..14-May-2021-

all/H14-May-2021-319249

internal/H14-May-2021-876640

testdata/H14-May-2021-6,0664,898

READMEH A D14-May-20211.6 KiB3426

asmdecl.goH A D14-May-202119.3 KiB731620

assign.goH A D14-May-20211.3 KiB5335

atomic.goH A D14-May-20211.6 KiB7053

bool.goH A D14-May-20214.4 KiB187128

buildtag.goH A D14-May-20212.3 KiB9275

cgo.goH A D14-May-20213.7 KiB142102

composite.goH A D14-May-20211.9 KiB8356

copylock.goH A D14-May-20216.5 KiB257195

dead.goH A D14-May-20212.3 KiB10982

deadcode.goH A D14-May-20216.7 KiB299220

doc.goH A D14-May-20215.6 KiB2251

httpresponse.goH A D14-May-20213.8 KiB138106

lostcancel.goH A D14-May-20218.7 KiB323237

main.goH A D14-May-202116.3 KiB630470

method.goH A D14-May-20215.8 KiB182130

nilfunc.goH A D14-May-20211.4 KiB6843

print.goH A D14-May-202122.3 KiB781615

rangeloop.goH A D14-May-20212.4 KiB10668

shadow.goH A D14-May-20216.9 KiB247156

shift.goH A D14-May-20212 KiB9977

structtag.goH A D14-May-20216 KiB227167

tests.goH A D14-May-20214.8 KiB188140

types.goH A D14-May-20219.2 KiB314219

unsafeptr.goH A D14-May-20212.7 KiB9864

unused.goH A D14-May-20212.4 KiB9472

vet_test.goH A D14-May-20215.5 KiB250207

README

1Vet is a tool that checks correctness of Go programs. It runs a suite of tests,
2each tailored to check for a particular class of errors. Examples include incorrect
3Printf format verbs and malformed build tags.
4
5Over time many checks have been added to vet's suite, but many more have been
6rejected as not appropriate for the tool. The criteria applied when selecting which
7checks to add are:
8
9Correctness:
10
11Vet's checks are about correctness, not style. A vet check must identify real or
12potential bugs that could cause incorrect compilation or execution. A check that
13only identifies stylistic points or alternative correct approaches to a situation
14is not acceptable.
15
16Frequency:
17
18Vet is run every day by many programmers, often as part of every compilation or
19submission. The cost in execution time is considerable, especially in aggregate,
20so checks must be likely enough to find real problems that they are worth the
21overhead of the added check. A new check that finds only a handful of problems
22across all existing programs, even if the problem is significant, is not worth
23adding to the suite everyone runs daily.
24
25Precision:
26
27Most of vet's checks are heuristic and can generate both false positives (flagging
28correct programs) and false negatives (not flagging incorrect ones). The rate of
29both these failures must be very small. A check that is too noisy will be ignored
30by the programmer overwhelmed by the output; a check that misses too many of the
31cases it's looking for will give a false sense of security. Neither is acceptable.
32A vet check must be accurate enough that everything it reports is worth examining,
33and complete enough to encourage real confidence.
34