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

x/tools/go/vcs: RepoRootForImportDynamic disallows vanity imports at the root of a domain #13506

Closed
zenazn opened this issue Dec 5, 2015 · 3 comments

Comments

@zenazn
Copy link
Contributor

zenazn commented Dec 5, 2015

vcs.RepoRootForImportDynamic requires that all vanity imports contain at least one / character: https://github.com/golang/tools/blob/c0008c5889c0d5091cdfefd2bfb08bff96527879/go/vcs/vcs.go#L483-L486

However, the documentation for vanity imports does not forbid vanity imports that do not contain a / (i.e., those at the root of a domain): https://golang.org/cmd/go/#hdr-Remote_import_paths

And in fact, go get (I tested 1.5.2) appears to do just fine with a vanity import located at the root of a domain. You can try go get goji.io as an example of this behavior.

This originally surfaced as a bug report against godoc.org, which uses similar logic (although it does not actually use the same code): golang/gddo#355. This bug report is, as much as anything, a spec clarification for that project.

@rsc
Copy link
Contributor

rsc commented Dec 28, 2015

Go 1.4 and earlier also rejected 'go get goji.io'. But the behavior here was inconsistent with the behavior once the source code was checked out, or when naming a subdirectory explicitly. So for Go 1.5 we fixed the inconsistency by allowing domain roots. That was #9357.

x/tools/go/vcs and godoc.org are both just out of date with respect to this fix.

@rsc rsc added this to the Unreleased milestone Dec 28, 2015
@dmitshur
Copy link
Contributor

I've made https://go-review.googlesource.com/#/c/18152/ that should resolve this issue.

@gopherbot
Copy link

CL https://golang.org/cl/18152 mentions this issue.

@golang golang locked and limited conversation to collaborators Dec 29, 2016
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

4 participants