You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat ~/foo/foo.go
package main
func main() {}
$ ln -s ~/foo $GOPATH/foo
$ go build foo # works
$ go list ... | grep foo # shows nothing
$
Should the Go tool support symlinks? Right now go build does, but go list does not.
The text was updated successfully, but these errors were encountered:
It's not build vs list. It's wildcards vs not.
If you say go build
, it resolves dir to its real value before continuing.
If you say go list ... it lists all known canonical paths.
I don't believe your example. I think it would show $GOPATH/src/foo as foo.
To make your example work you'd need to give the true $GOPATH dir a different name.
Symlinks cause all manner of weird behavior. It's best not to use them at all.
No intention to fix this, since I don't see what there is to fix.
Closing. The underlying bug is that x/tools/go/loader behaves differently than go build when given a package name. I thought I had distilled this down into an issue in the Go tool, but I suspect I was wrong. Leaving the original issue for @adonovan.
The text was updated successfully, but these errors were encountered: