-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 fmt doesn't work in symlinked directory #30336
Comments
When dealing with symlinks, filepath.Rel does not always return a valid path as described in golang#30336 This change makes sure that the shorter path is not used if it isn't valid. Fixes golang#30336
Change https://golang.org/cl/164957 mentions this issue: |
How deep is the actual working directory in your example? |
The example above was run from /home/tedu. |
#32725 is technically a duplicate of this issue, but that copy currently has more detail so I'm going to mark them the other way 'round. |
Duplicate of #32725. |
go version go1.11.4 openbsd/amd64
go fmt does not work when used in a symlinked directory.
I have some source buried under gopath, with symlinks for easy access.
This mostly works, but go fmt gets confused.
Something has gone wrong here with the combination of $PWD, getcwd, and path creation. go fmt has successfully found the file it wants to format, but constructs a path that doesn't work.
I found this issue about symlinks out of gopath, with a comment from rsc suggesting a symlink into gopath, which I read to mean this should work. #17451
Note that go build and go install both work fine.
Given a filename (go fmt *.go), it works. It's only "auto-finding" that screws up.
The text was updated successfully, but these errors were encountered: