Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: go fmt doesn't work in symlinked directory #30336
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.
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.