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

..04-Mar-2020-

all/H04-Mar-2020-319249

internal/H04-Mar-2020-876640

testdata/H04-Mar-2020-6,0664,898

READMEH A D04-Mar-20201.6 KiB3426

asmdecl.goH A D04-Mar-202019.3 KiB731620

assign.goH A D04-Mar-20201.3 KiB5335

atomic.goH A D04-Mar-20201.6 KiB7053

bool.goH A D04-Mar-20204.4 KiB187128

buildtag.goH A D04-Mar-20202.3 KiB9275

cgo.goH A D04-Mar-20203.7 KiB142102

composite.goH A D04-Mar-20201.9 KiB8356

copylock.goH A D04-Mar-20206.5 KiB257195

dead.goH A D04-Mar-20202.3 KiB10982

deadcode.goH A D04-Mar-20206.7 KiB299220

doc.goH A D04-Mar-20205.6 KiB2251

httpresponse.goH A D04-Mar-20203.8 KiB138106

lostcancel.goH A D04-Mar-20208.7 KiB323237

main.goH A D04-Mar-202016.3 KiB630470

method.goH A D04-Mar-20205.8 KiB182130

nilfunc.goH A D04-Mar-20201.4 KiB6843

print.goH A D04-Mar-202022.3 KiB781615

rangeloop.goH A D04-Mar-20202.4 KiB10668

shadow.goH A D04-Mar-20206.9 KiB247156

shift.goH A D04-Mar-20202 KiB9977

structtag.goH A D04-Mar-20206 KiB227167

tests.goH A D04-Mar-20204.8 KiB188140

types.goH A D04-Mar-20209.2 KiB314219

unsafeptr.goH A D04-Mar-20202.7 KiB9864

unused.goH A D04-Mar-20202.4 KiB9472

vet_test.goH A D04-Mar-20205.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