-
Notifications
You must be signed in to change notification settings - Fork 20
gohack does not allow relative directories in GOHACK env var. #44
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
Friendly ping; any news on this @rogpeppe ? Are you open to a PR for this issue ? |
Yes, very much so :) |
davidovich
pushed a commit
to davidovich/gohack
that referenced
this issue
Mar 27, 2019
Prior to this change, we were using filepath.Join to derive a replacement for the module dir. But this is not enough to support relative directories as Join() cleans the resulting path, removing any "./" prefix (which is needed by the replace drective when using a local directory). This change adds the "./" prefix if the user specified it in the GOHACK env var. Note that relative parent directory ("..") is not cleaned by filepath.Join, so we do not need to cater to this case. fixes rogpeppe#44
davidovich
pushed a commit
to davidovich/gohack
that referenced
this issue
Mar 27, 2019
Prior to this change, we were using `filepath.Join()` to derive a replacement for the module dir. But this is not enough to support relative directories, as `Join()` cleans the resulting path, removing any `"./"` prefix (which is needed by the replace drective when using a local directory). This change adds the `"./"` prefix if the user specified it in the GOHACK env var. Note that relative parent directory `".."` is not cleaned by `filepath.Join()`, so we do not need to cater to this case, and an added test proves that this works. fixes rogpeppe#44
davidovich
pushed a commit
to davidovich/gohack
that referenced
this issue
Mar 29, 2019
Prior to this change, we were using `filepath.Join()` to derive a replacement for the module dir. But this is not enough to support relative directories, as `Join()` cleans the resulting path, removing any `"./"` prefix (which is needed by the replace drective when using a local directory). This change adds the `"./"` prefix if the user specified it in the GOHACK env var. Note that relative parent directory `".."` is not cleaned by `filepath.Join()`, so we do not need to cater to this case, and an added test proves that this works. fixes rogpeppe#44
myitcv
pushed a commit
that referenced
this issue
Mar 29, 2019
Prior to this change, we were using `filepath.Join()` to derive a replacement for the module dir. But this is not enough to support relative directories, as `Join()` cleans the resulting path, removing any `"./"` prefix (which is needed by the replace drective when using a local directory). This change adds the `"./"` prefix if the user specified it in the GOHACK env var. Note that relative parent directory `".."` is not cleaned by `filepath.Join()`, so we do not need to cater to this case, and an added test proves that this works. fixes #44
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We want to be able to set GOHACK to a relative dir, say
./
. But this is not possible at the moment as the initial./
is removed in the replace directive, creating a broken replacement line for go:We can work around the problem by manually prefixing the replacement with
./
.We like the relative path use-case, because it allows enhanced interop in WSL, when the path is on a shared Windows mount (/mnt/c/...), Windows go tools can interpret the same (relative) path as the WSL go tools. With absolute paths, Windows tools obviously cannot interpret the
/mnt/c/...
mount.This is somewhat related to #27.
The text was updated successfully, but these errors were encountered: