1

The main problem here is .. that I have installed the package control and also the gosublime plugin but it is not working. Also it is not working in the command prompt when I type go. It gives info proving that the go is installed correctly in path I am actually trying to use a separator to set paths for go and java simultaneously which I might be doing wrong.

ENVIRONMENT VARIABLE

Now in sublime text 3 i am receiving an error as

MarGo: Missing required environment variables: GOPATH | > See the Quirks section of USAGE.md for info

I went through this but it didnt help me

Sublime Text: "MarGo: Missing required environment variables: GOPATH"

kristianp
  • 5,496
  • 37
  • 56
Gopherine
  • 1,021
  • 12
  • 24
  • Related (with alternative solution): http://stackoverflow.com/questions/31516808/sublime-text-margo-missing-required-environment-variables-gopath?rq=1 – atamanroman Jan 30 '16 at 14:21
  • @atamanroman i dont think you got the point there it is for windows i already mentioned that link above and it is not working out for me and am still getting the error more over the problem is soleved using the shell script which i dont think is viable for windows there must be some command inplace of that for windows. – Gopherine Jan 31 '16 at 05:10

3 Answers3

2

in windows sublime text 3
ctrl+shift+p
type install package enter
search for golang build enter

Abhishek D K
  • 2,257
  • 20
  • 28
1

You have to set the GOPATH environment variable to something like d:\myprojects\go. That's where your code and libraries will be stored.

Your code should be located in a folder like d:\myprojects\go\src\github.com\pandey\coolproject.

Relevant section from the docs:

[...]

Test your installation

Check that Go is installed correctly by setting up a workspace and building a simple program, as follows.

Create a directory to contain your workspace, $HOME/work for example, and set the GOPATH environment variable to point to that location.

$ export GOPATH=$HOME/work You should put the above command in your shell startup script ($HOME/.profile for example) or, if you use Windows, follow the instructions above to set the GOPATH environment variable on your system.

Next, make the directories src/github.com/user/hello inside your workspace (if you use GitHub, substitute your user name for user), and inside the hello directory create a file named hello.go with the following contents:

[...]

(https://golang.org/doc/install#testing)

See the Go docs for more details, especially on how to do it on windows: https://golang.org/doc/install

atamanroman
  • 11,607
  • 7
  • 57
  • 81
  • I did setup that workspace now cleanly its compilable and the hello world program is running.when i am using notepad but the error still seems to arise in sublime text and it is still saying mar go missing required variable path GOPATH – Gopherine Jan 31 '16 at 05:05
  • Did you restart sublime after setting GOPATH? – atamanroman Jan 31 '16 at 17:17
  • ok i figured it out and finally removed the margo problem but the only problem now is i cant build the program what i did is i went into gosublime default setting and set the path and gopath in the env then the error was gone but i cant build my code it generates a dialogue box telling to see the documentation and fails to build it ..... i followed "https://github.com/golang/sublime-build/blob/master/docs/configuration.md" this link – Gopherine Feb 01 '16 at 13:14
0

I haven't had a good experience installing gosublime recently, the margo instructions are not very helpful. You could try gopls instead, it's still in alpha, but it's developed by the go team. It's a language server for go, that works with a Sublime LSP plugin.

https://github.com/golang/tools/tree/master/gopls

Instructions for Sublime are here.

kristianp
  • 5,496
  • 37
  • 56