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: undo replacement of -vettool with $GOVETTOOL #28636

Closed
rsc opened this issue Nov 7, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@rsc
Copy link
Contributor

commented Nov 7, 2018

Recently @alandonovan replaced -vettool with $GOVETTOOL because it simplified command line parsing a little. We should undo that. An environment variable is not appropriate for per-command configuration - that's what the command line is for - and the parsing of -vettool can run the tool to learn the other flags.

@rsc rsc self-assigned this Nov 7, 2018

@rsc rsc added the release-blocker label Nov 7, 2018

@rsc rsc added this to the Go1.12 milestone Nov 7, 2018

@alandonovan

This comment has been minimized.

Copy link
Contributor

commented Nov 7, 2018

The problem that the environment variable solves is that by the time you parse the -vettool flag, it's too late to run that tool to report its flags because you've already started parsed the command line.

An alternative might be to implement an ad-hoc command-line parser that searches for -vettool or -vettool=... among os.Args and ignores all other arguments. It's not 100% correct w.r.t. flag parsing semantics but it might be good enough.

@gopherbot

This comment has been minimized.

Copy link

commented Nov 8, 2018

Change https://golang.org/cl/148497 mentions this issue: cmd/go: vet: revert $GOVETTOOL env var, restore -vettool flag

@gopherbot gopherbot closed this in 5896335 Nov 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.