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: command with file with wrong package silently fails to build #3389
Labels
Milestone
Comments
Labels changed: added priority-go1, removed priority-triage. Owner changed to @rsc. Status changed to Accepted. |
In issue #3390 I asked: "Just to check, is it okay to use stuff under cmd? e.g. src/cmd/foo? Or is the whole cmd/* reserved? If it is, an error might be better than having it mostly work." Based on Russ's comment here, it seems the answer is that cmd/* is reserved if you are in a GOROOT project. Maybe the go tool shouldn't build anything under any GOPATH's src/cmd directory then? I can see other people making the same mistake as we have. src/pkg sorted itself out, because there your import path would be pkg/foo, which no-one wants. |
Silent was the wrong word. The confusing thing was that this doesn't work: $ rm -rf bin pkg; GOPATH=`pwd` go install -v cmd/bar can't load package: package cmd/bar: open /path/to/go/src/cmd/bar: no such file or directory but this does work: $ rm -rf bin pkg; GOPATH=`pwd` go install -v cmd/foo/bar It's much less confusing when you know that cmd/* is kind of reserved and that cmd/*/* is "less" reserved. |
This issue was closed by revision 8b6534b. Status changed to Fixed. |
alberts
added
fixed
Suggested
Issues that may be good for new contributors looking for work to do.
labels
Jan 31, 2013
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
The text was updated successfully, but these errors were encountered: