golang / go

The Go programming language

Home Page:https://go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GO15VENDOREXPERIMENT does not work outside GOPATH

FiloSottile opened this issue · comments

The exact same package, which imports code from its ./vendor/ folder, will correctly go build if placed in $GOPATH/*, but will fail to find the packages in ./vendor/ if placed anywhere else.

The two different behaviors are surprising.

This was turned off in b6ead9f

It's not intended to work. Vendor is for fully-qualified imports (not relative ./ ones), and those only work inside $GOPATH.

I see. Can you point me to the rationale/discussion? Because I think it can really confuse newcomers, since they won't be able to just clone a repository and run go build anymore. (Unless obviously there's some Makefile overriding GOPATH, but that's kind of what we want to avoid?)

Let's move discussion to a forum. See https://golang.org/wiki/Questions

@FiloSottile FYI you can make a softlink to anywere else and "go build" will work correctly there.