Settings of the Go language

Asked

Viewed 452 times

0

I need to do a job in college and I chose to do it in Go language because I wanted to learn a new language. Yesterday I installed . msi of the site and saw that I needed to configure the variables GOPATH, PATH and GOROOT. I set them up this way:

  • GOPATH = C:\Users\Gustavo\goprojects (where the folder goprojects I created and it’s where I want all my Go language projects to be)
  • GOROOT = C:\Go\ (folder where the Go language was installed)
  • PATH = C:\Users\Gustavo\goprojects\bin

So far so good. However I use Eclipse IDE and searching I saw that it has a plugin called Goclipse that makes Eclipse a Go language IDE, so I installed it by Eclipse’s own Marketplace.

After all this done, I created a new Go project and put the project on the path C:\Users\Gustavo\goprojects, and created a new . go inside a folder that is inside the src folder. When I went to write a Hello World, every time I tried to make him complete the code alone it appears an error then I went to see and saw that I needed to download another plugin to work the self-completing, and this plugin calls gocode which is a project that’s on Github.

And here’s my problem. Where and how do I download this folder and how do I activate it in my Eclipse? Did I set the variables correctly? I need to do something else?

P.S.: Use Windows 8.1, I have git installed.

  • normally you do not replace the PATH completely, but add new directories/folders; in your case it would look like this: PATH = %PATH%;C: Users Gustavo goprojects bin

3 answers

1

Supposing that the project gocode to which it refers is this: https://github.com/nsf/gocode, just turn the command:

go get -u github.com/nsf/gocode

This will make the package properly installed and its binary available in the folder $GOPATH\bin.

0

Gustavo, I am programming in GO, I strongly advise to focus on this language.. and a suggestion because I am a programmer for many years.. It uses linux to program in GO, it can even be a Virtualbox and I like to use ATOM, it has several interesting plugins.

0

Regardless of any project you use, I recommend using Go’s workspaces recommendation. In the documentation they explain how you should create these workspaces.

With this you can make your projects very well structured, and standardized.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.