Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/vet: document better the cmd/go flags that go vet supports #21711
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
There is no reason whatever to pass -ldflags to vet. Just remove that flag from the call.
The documentation could be better. The "standard build flags" really refers to compile-time features such as -n, -x, and -tags. The word "build" is being misused; a better term might be "diagnostic and package-finding".
Go vet never builds, so any try build-time flags are pointless. The issue is how the go command identifies packages to pass to go tool vet.
I imagine that the flag was simply ignored before, as
In any case, as @robpike says, it's very unlikely that the flag ever did anything useful before. The flag isn't supposed to work; vet doesn't build packages like