-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: test hides -v from underlying binary #7221
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
Labels
Milestone
Comments
Issue #7235 has been merged into this issue. |
I do not believe the -- fix is correct. I expect go test foo -- -v 27 to invoke: foo.test -- -v 27 The shadowing of -v is fundamental to the design of the merged command line that 'go test' accepts. Renaming the test's flag is the easiest fix. I believe the issue as stated (cmd/go: test hides -v from underlying binary) is working as intended. If for some reason a test needs to use the same flag as a standard 'go test' option, a workaround is to take advantage of the fact that an unrecognized flag marks the end of the 'go test' flags, and put this in the test: var myflags = flag.Bool("myflags", false, "unused") and then invoke go test -myflags -v |
CL https://golang.org/cl/17775 mentions this issue. |
mk0x9
pushed a commit
to mk0x9/go
that referenced
this issue
Dec 17, 2015
The new flag -args stops flag processing, leaving the rest of the command line to be passed to the underlying test binary verbatim. Thus, both of these pass a literal -v -n on the test binary command line, without putting the go command into verbose mode or disabling execution of commands: go test . -args -v -n go test -args -v -n Also try to make the documentation a bit clearer. Fixes golang#7221. Fixes golang#12177. Change-Id: Ief9e830a6fbb9475d96011716a86e2524a35eceb Reviewed-on: https://go-review.googlesource.com/17775 Reviewed-by: Rob Pike <r@golang.org>
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: