Im trying to set a different GOPATH for every project, I have achieved this on vs code and intellij idea, somehow there is no easy way to do this is someone know I will appreciate some help.
Use case: We use a gopath per project here at work, and seems like go-plus only support one afaik.
In atom, you can install package atomenv. Once installed, you need to add a file at the root of your project, named .atomenv.json
. This will help you to set variable environments per project in atom.
For GOPATH, edit the file .atomenv.json
:
{
"env": {
"GOPATH": "$HOME/go:$ATOM_PROJECT_PATH"
}
}
($HOME/go
is where your main gopath is, for example)
Then you need to call atomenv:load
(CTRL+SHIFT+P atomenv:load).
If you use go-plus, the (i) go tab will now show your new GOPATH!