README 1.6 KB

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