-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: fix go get for paths ending with .go #14923
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
Comments
That is kind of a terrible name for that directory. It's confusing to use because the package name does not match the directory name. But I guess I can't think of a reason that the go tool should not support it. |
It has happened before, if we accept .go import paths, then what about go
build with such paths? How could go build disambiguate such import paths
with a Go source file? No, i don't think trying both interpretations is the
way to go.
I vote for this being working as intended.
|
CL https://golang.org/cl/20893 mentions this issue. |
I agree with @minux there is already enough confusion around go build and go test supporting The clincher for me is I vote to close this as unfortunate. |
I don't get your concerns about go build with such paths. Can't go just check if the path is a file or a directory? My package is not the only one I have found ending in .go. I can very well rename it to have the .golang suffix (or any other name) and avoid this issue. But what about the several packages out there with the same issue (and future ones that will run into it eventually)? I agree that the name of the package is not good, but go tools failing inconsistently due to directories with the .go suffix without being noisy about it is worse imho. Reference: gojp/goreportcard#90 |
What about adding info to the docs that directories should never end with .go and / or failing noisy when it happens for the know reasons? |
Or, better yet, explaining that projects / package directories should always use valid package names... |
Blocked on Code-Review Label |
go version
)?1.6
go env
)?Tried to clone github.com/launchpad-project/api.go with:
go get github.com/launchpad-project/api.go
Expected
go get
to work as intended.stat error (not found).
I have written and sent a one-line patch to https://go-review.googlesource.com/#/c/20893/1
This affects gojp/goreportcard#90 as well.
The text was updated successfully, but these errors were encountered: