From b5aa93b2914caa3cec52bf029c9c17e86d8940fb Mon Sep 17 00:00:00 2001 From: Morgan Howard Date: Mon, 11 Oct 2021 20:31:24 -0700 Subject: [PATCH] go-vet: add page (#6832) --- pages/common/go-vet.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pages/common/go-vet.md diff --git a/pages/common/go-vet.md b/pages/common/go-vet.md new file mode 100644 index 0000000000..eea4fccca4 --- /dev/null +++ b/pages/common/go-vet.md @@ -0,0 +1,29 @@ +# go vet + +> Check Go source code and report suspicious constructs (e.g. lint your Go source files). +> Go vet returns a non-zero exit code if problems are found; returns a zero exit code if no problems are found. +> More information: . + +- Check the Go package in the current directory: + +`go vet` + +- Check the Go package in the specified path: + +`go vet {{path/to/file_or_directory}}` + +- List available checks that can be run with go vet: + +`go tool vet help` + +- View details and flags for a particular check: + +`go tool vet help {{check_name}}` + +- Display offending lines plus N lines of surrounding context: + +`go vet -c={{N}}` + +- Output analysis and errors in JSON format: + +`go vet -json`