GoSublime: Idiotproof instructions for MarGo: Missing required environment variables: GOPATH
Hi. I installed this package. Now whenever I open Sublime Text (any file), this error message appears in the console
MarGo: Missing required environment variables: GOPATH
See theQuirkssection of USAGE.md for info
and a document usage.MD spontaneously opens.
How can I fix this? I tried to follow the instructions, but I’m new to both Go and Sublime Text , and don’t quite understand what to do . I opened Packages\User\GoSublime.sublime-settings but it was blank. Also found GoSublime\GoSublime.sublime-settings but that only mentioned GOPATH offhand.
This is my fault for being an idiot, but would it be possible to idiotproof the instructions? Or better, make the package work out the box, if that’s possible.
If it helps, I installed Go at C:\Go. Is that what I should put?
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
Go to: Preferences -> Package Settings -> GoSublimge -> Settings – User add {“env”: {“GOPATH”: “$HOME/go”}}
For anyone else with zsh on Mac OS X:
My GOPATH and GOROOT are set but for some reason MarGo wasn’t seeing them after I installed zsh. Putting them in my GoSublimge -> Settings – User (not general Settings – User, that tripped me up) fixed this issue.
My overall experience of getting this plugin working is that the instructions are inadequate. A link to the go environment setup: https://golang.org/doc/code.html would be good… With the standard disclaimer: “If you don’t know what GOPATH is go read this”.
For me the real issue was that the usage.md file stated:
When in fact there’s no documentation on those settings in any of the files. I had to google it up and it wasn’t an instant hit. I did find this article: http://www.wolfe.id.au/2015/03/05/using-sublime-text-for-go-development/ which explained the process.
Perhaps there used to be documentation on those settings, however there’s nothing in my completely fresh Sublime 3 install.
Correct, you are making a syntax mistake, the correct syntax is:
In your example, you created two values both with the key
envwhich means the second overwrote the first.