Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go vet should take vet's flags #19350

Closed
robpike opened this issue Mar 1, 2017 · 1 comment
Closed

cmd/go: go vet should take vet's flags #19350

robpike opened this issue Mar 1, 2017 · 1 comment

Comments

@robpike
Copy link
Contributor

robpike commented Mar 1, 2017

Currently the docs for cmd/go say (and the code agrees):

To run the vet tool with specific options, run 'go tool vet'.

This means that the careful argument construction that the go tool does, which takes into effect things like cgo, cannot be applied easily if one wants a special vet flag.

I propose to fix go vet to be more like go test, passing vet's own flags through. This will require a little code copying but shouldn't be too hard.

This change would make it easier to roll out experimental, opt-in flags for vet, which is my main motivation.

@rsc rsc changed the title proposal: go vet should take vet's flags. proposal: cmd/go: go vet should take vet's flags Mar 6, 2017
@rsc rsc changed the title proposal: cmd/go: go vet should take vet's flags cmd/go: go vet should take vet's flags Mar 6, 2017
@rsc rsc added this to the Go1.9 milestone Mar 6, 2017
@robpike robpike self-assigned this Apr 9, 2017
@gopherbot
Copy link

CL https://golang.org/cl/40112 mentions this issue.

lparth pushed a commit to lparth/go that referenced this issue Apr 13, 2017
This allows the go tool to run "go vet" with both the build flags
that make sense, such as -x and -tags, and vet with all its flags.

To do this, create a new package cmd/go/internal/cmdflag to
hold functionality common to flag handling for test and vet.

Fixes golang#19350

RELNOTES=yes

Change-Id: Ia1ae213bd3f6cab1c5e492501c8d43ce61a7ee89
Reviewed-on: https://go-review.googlesource.com/40112
Reviewed-by: Russ Cox <rsc@golang.org>
@golang golang locked and limited conversation to collaborators Apr 10, 2018
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants