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: support ~ in import paths #9193
Comments
Sadly I am postponing this to Go 1.6. It is too late to find out what the answer is here. I am worried about Windows in particular having unanticipated problems with the ~. |
@adg You should add Proposal Label here (I read you are going to do discussions about proposals). |
If someone wants to write a proposal document for this, I'd be happy to provide feedback. |
Does this really need a full proposal? I'd say fix the regexp, test on Windows, and ship it if it works there? |
The possible problems I expect on Windows are subtle (remember that ~ is how Windows shortens long path names to 8.3 format). "Test it once and ship it" is NOT okay. It may be okay to accept ~ only at the beginning of a path element. |
~ is a shellism, once the program (not just a go program) gets hold of the This proposal is about trying to make ~ expansion happen in the case where On Sat, 24 Oct 2015, 13:55 Russ Cox notifications@github.com wrote:
|
I think just supporting ~ as the first character in
a import path component will solve a lot of the
problem.
It's because the homedir feature of various http
servers where http://host/~userA will be serving
userA's $HOME/public_html. It seems fine to
host packages there.
|
I don't see why ~ wouldn't work in windows paths:
Alex |
@davecheney, are you sure this is about shell expansion? The initial report says I thought this proposal was about supporting git servers that use the literal substring /~user/ in their git URLs. For example I thought launchpad.net did this, and in fact such examples are in our docs:
I don't have bzr installed and I don't know of any launchpad users to try looking for code. Can someone check what happens if you try to go get a launchpad.net/~user path? If it doesn't work, we should fix that. We can do that by allowing ~ as the first character of a path element, but no in general. @alexbrainman, what concerns me about Windows paths is the ambiguity it might introduce. It's true that if you create paths with ~ in them you can get to them, but on most systems you can also, for example, type "c:\progra~1" instead of "c:\program files", and it's that access to shortened names that I want to disallow. |
I hear you @rsc. This program https://play.golang.org/p/PDKP6ZfV0X fails with:
|
This proposal is accepted provided it's only about leading ~ in path elements. I thought that worked already, and there are examples in the go command docs saying it should work, so that seems pretty unobjectionable. Would still like to hear whether it actually works. |
CL https://golang.org/cl/17952 mentions this issue. |
by henderson.bj:
The text was updated successfully, but these errors were encountered: