-
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: Go not traversing symlinks #17451
Comments
The go command uses filepath.Walk to match packages, and filepath.Walk does not follow symbolic links at this time. Changing this means either modifying filepath.Walk or creating a custom walk that resolves symbolic links. I would not encourage the first option on due to Compatibility guidelines. I rely on filepath.Walk behavior not to follow symlinks, and on many Linux systems I use this would cause circular non-terminating traversals.
|
Ah thanks for the response @as - this makes a lot more sense now. I would say it's safe to set this is a nuisance more than anything else. But I still am curious if the issue needs to be addressed? Is the ability to follow symlinks in this context something we would like to see in a later version of |
There was a proposal to add this feature in May, but it was declined. The reason is that symlinks introduce too much complexity and aren't worth their trouble. I agree with the reason. The symlinks on my Linux systems were created by the distribution builders and I personally avoid them. If you're unable to use hard links, maybe 'mount -o bind' can solve your problem by approximating a namespace in Linux. |
Like in #15507, we're not going to attempt this. It creates too many other issues. You could instead symlink ~/myproject -> your GOPATH. Apologies. |
This reverts commit 6c1fd2c, because it breaks normal operation due to <golang/go#17451>.
V 1.6.2 Darwin/AMD64
I would expect go to respect and follow the symlink and traverse the path as it would with a hardlink.
The text was updated successfully, but these errors were encountered: