4 ms·
The difference is the Go tooling is dictating your whole code layout that may not match your personal preference. I work in a multitude of languages and I orga
by KallDrexx 9y ago
The difference is the Go tooling is dictating your whole code layout that may not match your personal preference. I work in a multitude of languages and I organize my code in ~/code/work for work/contracting code bases, ~/code/personal for my code bases and ~/code/third-party for source code I want to look at and maybe contribute casually to. I have never figured out a good way to fit GOPATH into this without completely rearranging how I organize my code, which I have zero desire to do for one language, especially one that's not my main.
- zaarn 9y agoYou can specify multiple GOPATHs which will be searched in order for packages; Your GOPATH could be set to "~/libs/go:~/code/work for work/contracting/go:~code/personal:~/code/third-party" which would put any go-get libaries into ~/libs/go and allow using packages from the other folders. Keep in mind that Go will still use these Gopaths like any other Gopath repository; create a src/pkg/bin folder set for use with the compiler
- KallDrexx 9y agoThat's good to know, I had never come across that! Thanks.