Re:Go Modules in 2019
by pjmlp on Wednesday December 19, 2018 @12:53PM
(#18717653)
The ones listed by you apply mostly as library search path, while go compilers required GOPATH to point to the project being compiled.
[ Parent
| on HN ]
False.
You can put your code anywhere you want and `go build` and `go run` will work just fine.
It's only third party libraries that have to be in GOPATH, which is exactly a library (well, package) search path.
Re:Go Modules in 2019
by aeijdenberg on Wednesday December 19, 2018 @05:11PM
(#18720258)
False only for very small values of code.
ie if your code itself is split into modules, they won't work (as they are imported by their full path, not relatively), and anything in your vendor dir is also ignored when used outside of a GOPATH entry.