4 ms·
GOPATH is optional now GOPATH isn't optional; it just has a default value now. If you're using anything in a vendor folder, you still need to set GOPATH to a
by shadowmint 10y ago
GOPATH is optional now
GOPATH isn't optional; it just has a default value now.
If you're using anything in a vendor folder, you still need to set GOPATH to a parent folder of your /src/project.
ie. `vendor` is still ignored if it is outside GOPATH; and if you don't set GOPATH, it just defaults to `$HOME/go`. If you ignore GOPATH and don't set it, your code won't build.
You still need GOPATH for now.
(once vendor can exist outside of GOPATH we can really start moving forwards with things)
- libeclipse 10y agoIs this likely to happen?
- shadowmint 10y agoThe tracking issue is here: https://github.com/golang/go/issues/17271 https://github.com/golang/go/issues/17271 Maybe? I think broadly the answer is yes, but not very soon. It'll probably be a timeline like: - Sometime between now and 1.10 / 1.11 - allow vendor outside of GOPATH - 1.11 / 1.12 - dep formally becomes part of the go toolchain - 1.12+ ?? - GOPATH stops existing or significantly changes form. I'm just speculating based on the progress of dep and the discussions in various issue trackers. Nothing is going into 1.9; it's not ready yet even as a candidate feature. 1.10 could see some changes, and beyond that there will definitely be some kind of changes. ...but probably not this year.
- grey-area 10y agoYes sorry that was badly phrased. Should have been Setting gopath... I'm confident they will gradually get rid of it. It was a convenient crutch at first but for those outside a mono repo quite limiting.