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: invalid flag for go test doesn't give very useful error #3260

Closed
alberts opened this issue Mar 9, 2012 · 1 comment
Closed

cmd/go: invalid flag for go test doesn't give very useful error #3260

alberts opened this issue Mar 9, 2012 · 1 comment

Comments

@alberts
Copy link
Contributor

alberts commented Mar 9, 2012

What steps will reproduce the problem?

Invalid flag for go test doesn't give very useful error.

this works:

GOPATH=`pwd` go test ./...

this doesn't:

GOPATH=`pwd` go test -argh ./...

the problem is the error message:

can't load package: package .: no Go source files in /home/alberts/next.master

this becomes a problem when you start writing stuff like:

GOROOT=~/go GOPATH=~/foo TMPDIR=$GOPATH go test -v -c -keep foo

and you actually were supposed to write -work instead of -keep and then can't figure out
what's going on.

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

linux

Which revision are you using?  (hg identify)

go version weekly.2012-03-04 +ee68d043e7f5
@rsc
Copy link
Contributor

rsc commented Mar 9, 2012

Comment 1:

I can't do anything about this.  What if your test binary
defined a -argh flag that took ./... as its parameter?
When we see an unrecognized flag, we assume the package
list is over.
The only thing I can suggest is to get in the habit of writing
go test foo -v -c -short
instead of
go test -v -c -short foo
Russ

Status changed to Unfortunate.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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