-
Notifications
You must be signed in to change notification settings - Fork 18k
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: get $VANITYDOMAIN is flaky #9357
Comments
On a side note, I intend to move (copy) the repro to a permanent location that includes the issue ID, but I'm not sure if it's better to update the original comment with the final URLs, or just post them in a new comment (or it's better to just leave the repro where it is, or it's not even necessary to keep it after the issue is resolved). |
I don't think this is a bug, excluding vanity domains for a second, would
To work ? I don't think it should, and for the same reason that go get dfc.io Would also not work.
|
|
@davecheney @adg |
@speter. I don't think it is inconsistent, go get has never allowed you to go get a bare domain, there has always been a requirement to to have at least one path element. So
Is not a package that go get knows how to get, while
is a package that go get knows how to get. Given the way the go get infers URLs from import statements, this seems like a reasonable trade off. |
@speter I misread your original report. I agree this inconsistency is weird. It's also problematic because if package |
Thank you for taking the time to look at it (again). Sorry, my initial report could have been organized/worded better, and it included too much low-level technical details with little background explanation. I've thought about it a bit more and hopefully managed to summarize the issue(s) better. TL;DR version:
Detailed version: I was thinking in the context of a domain specifically for a single project (as opposed to github or user domains that host multiple projects/repos, thus implying a hierarchy in the package path). I wanted to enumerate the potential layouts I should/could consider, and started playing with this because it wasn't obvious from the docs ( @adg 's example
The same works when the prefix is a subdirectory:
Then, for both the transitive import example in the initial report, and in case we want to allow Consider for example if a package like fsnotify was called "fileevents", and hosted at, say, Even just thinking about how such a limitation could be documented (in a way that is useful for package publishers) makes it sound very odd to me: "You can put packages in any directory of your repo, except if you want to host it at the top level of your domain, in which case you cannot have a package in the repo root." Or, "You can host your repository at any level of your domain, except if it has a package in the root directory, in which case you must use a subdirectory of your domain." |
For reference, Google's Search Engine Optimization Starter Guide ("Use words in URLs", page 9) directs to
This seems to support my observation that requiring an extra directory level when the domain name already conveys the package's name/purpose works against present day URL design best practices. (I believe that in the above example comparing "file.events" vs "file.events/fileevents", the repeated "fileevents" would qualify as an excessive keyword, and using a different directory name such as "file.events/pkg" would also be undesirable.) |
CL https://golang.org/cl/12193 mentions this issue. |
CL https://golang.org/cl/18152 mentions this issue. |
This is the same change as in https://golang.org/cl/12193. Fixes golang/go#13506. Related to golang/go#9357. Change-Id: I9c7d956008641b1907e14bcb08198235f5f9552f Reviewed-on: https://go-review.googlesource.com/18152 Reviewed-by: Russ Cox <rsc@golang.org>
go get $VANITYDOMAIN
doesn't work (doesn't even do any network request):On the other hand,
go get $VANITYDOMAIN/$PKG
works and the sub-package can import the package at the root of $VANITYDOMAIN that was got together with it as well:It seems that the implementation doesn't make a request unless the cleaned import path contains a '/', but the current behavior is clearly inconsistent, so I believe it should also get the repo when using the first command (some people may be relying on the behavior of the second command already -- even unknowingly).
The text was updated successfully, but these errors were encountered: