-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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 replace statements #33586
Comments
Does the file support $HOME? Because ~ is some modern aberration (says the old grump). |
It doesn't support $HOME either. I suggested ~ because $HOME would likely be the only expansion available, but I don't have a strong opinion between the two. |
@FiloSottile I think adding this feature will be more complicated than we usually thought, I invite you to read https://unix.stackexchange.com/q/146671/38906 |
I also think it's a slippery slope to start putting expressions that must be evaluated into module specification. |
@cuonglm, I think the natural meaning of |
If you are going to do anything at all I think it should be to call os.ExpandEnv, but my vote would be to do nothing. |
I tend to agree with @ianthehat and @robpike on this. Relative paths are one thing, since there is a pretty solid use-case for pointing a See previously #27824. |
I have a scenario for supporting ~ (expanding to user home directory): Now, if I want to "upgrade A" from package to module, I have to utility "replace" in go.mod to reference "A". The absolute path of "A" does not work for both. If the "replace" supports ~ or environ variables, it would be great! |
I share some directories between machines with different user names. It would be useful to be able to add a statement like the following to a go.mod.
The text was updated successfully, but these errors were encountered: