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

cmd/go: use stat rather than lstat to read root dir in fsys.Walk #50807

Open
matloob opened this issue Jan 25, 2022 · 2 comments
Open

cmd/go: use stat rather than lstat to read root dir in fsys.Walk #50807

matloob opened this issue Jan 25, 2022 · 2 comments
Assignees
Labels
early-in-cycle GoCommand NeedsFix
Milestone

Comments

@matloob
Copy link
Contributor

@matloob matloob commented Jan 25, 2022

cmd/go currently doesn't follow symlinks when looking for packages when module roots (or the current directory in the case of ...). Though we don't want to follow symlinks within modules, it is often confusing to users when their current working directory is a symlink. When walking a directory tree, use stat rather than lstat when reading the root directory to follow the symlink. This will allow users to use the go command as they'd expect when the working directory is a symlink following symlinks within modules.

@bcmills

@matloob matloob added this to the Go1.19 milestone Jan 25, 2022
@matloob matloob self-assigned this Jan 25, 2022
@bcmills
Copy link
Member

@bcmills bcmills commented Jan 25, 2022

I filed #50804 for the equivalent behavior in filepath.Walk, although I'm not particularly hopeful that anything will change on that side.

@bcmills bcmills added GoCommand NeedsFix early-in-cycle labels Jan 26, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Mar 16, 2022

This issue is currently labeled as early-in-cycle for Go 1.19.
That time is now, so a friendly reminder to look at it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
early-in-cycle GoCommand NeedsFix
Projects
None yet
Development

No branches or pull requests

3 participants