Run go vet for standard checks and staticcheck for advanced analysis to catch bugs and improve code quality.
Run go vet for standard checks and go vet -vettool=$(which staticcheck) to run the Staticcheck analyzer suite on your codebase.
go vet ./...
go vet -vettool=$(which staticcheck) ./...
Note: staticcheck must be installed separately via go install honnef.co/go/tools/cmd/staticcheck@latest before running the second command.
Go vet is a built-in tool that catches common mistakes like formatting errors or unreachable code. Staticcheck is a more powerful, third-party tool that finds deeper bugs and suggests modern code patterns. You run them together to ensure your code is both correct and idiomatic before sharing it.