How to set up Golang IDE for Mac

I am trying to set up an IDE for Go and am having difficulty. I have chosen to use Goland by JetBrains but am open to suggestions if someone has a better option. My issue is that it asks me to configure GOPATH and I have no clue how to do it. I am assuming that is why i am having issues, I am trying to run MeasureTheFuture software as part of a project. The operating system is Mac. Any help or guidance is appreciated, first time using Go or Mac.

Thank You in advance.

Did you install go as well? If yes, just edit .bash_profile in your home directory and put the following lines::

export GOROOT=$(go env GOROOT)
export GOPATH=$(go env GOPATH)
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/bin:/usr/local/sbin:$PATH

If you already have export PATH there, then you have to edit this line.

I you haven’t installed go, I suggest to install it via homebrew.

So, only execute the same code of @acim above, or:

cd yourproject/
export GOPATH=$( pwd )
export PATH=$PATH:$GOPATH/bin

Open your IDE, click in “Preferences”> Go> GOPATH
“Project GOPATH” and put your path of your project for the IDE make the autocomplete the libraries.
and recognize then

Maybe this helps:

https://golang.org/doc/code.html#GOPATH

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.