Golang can compile a project residing in any directory.
Why does dep ensure require that the project resides under GOPATH/src? Why can't it just resolve the dependencies into the current directory (where Gopkg.toml is located)?
I don't want to put everything under GOPATH. Can I not use dep at all?
Hello @rustyx
In my case we just added some symlinks of the project code to the GOPATH/src folder. The only "issue" is that we just have to run dep ensure from within GOPATH/src/<project>. Could that work on your setup?
Thanks for the suggestion. Interesting workaround.
But I really want to know - why can't I put my project outside GOPATH and run dep ensure in there? What's the technical difficulty that prevents dep from working outside GOPATH?
Golang can compile a project residing in any directory.
vgo can. That's quite recent.
We likely won't be adding seamless support for it in dep, but our alternative to vgo will certainly support it. See this for some background.
That said, if you want to run dep ensure from anywhere, the recently-added DEPPROJECTROOT env var can allow that, too. It's only in tip for now, but it will be in the next release (later this week).
Most helpful comment
vgo can. That's quite recent.
We likely won't be adding seamless support for it in dep, but our alternative to vgo will certainly support it. See this for some background.
That said, if you want to run
dep ensurefrom anywhere, the recently-addedDEPPROJECTROOTenv var can allow that, too. It's only in tip for now, but it will be in the next release (later this week).