Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GOPATH is empty (Gogland IDE)

Tags:

People also ask

How do I find my current Gopath?

It defaults to a directory named go inside your home directory, so $HOME/go on Unix, $home/go on Plan 9, and %USERPROFILE%\go (usually C:\Users\YourName\go ) on Windows. This means the GOPATH environment variable is not necessarily set to anything in particular.

Is Gopath needed anymore?

Since 1.12 version Go modules is enabled by default and the GOPATH will be deprecated in 1.13 version. For those who are getting started with Go 1.12, the installation and set up goes will be as follows.

How do I find Gopath in Windows?

To check if the GOPATH has been appropriately configured open run dialog by pressing win + r and type %GOPATH% and hit the OK button. If it takes you to the C:\Projects\Go directory, the configuration was successful.

How do I set Gopath variables?

To set GOPATH, open the bashrc/ bash_profle/zshrc file and type the following commands in it and then save the file. pkg − the directory that will contain the packages and shared object files if any. src − the directory where all the code you will write will be stored.


I am pretty new to Go and Gogland. I just downloaded 'go1.8.3.windows-amd64.msi', installed it in C Drive and then started writing my programs in a notepad and then finally running it from a terminal.

I am facing some issues with Gogland. I have intelliJ IDEA Ultimate But I have been asked to use Gogland. I do not know whether this is the correct decision. You may want to advise me on the same. I just created a new project, gave it a name and added a go file into it which has simple helloworld code. But it shows me an error "GOPATH is empty".

Gogland editor

As you could see the message at the top, just above the line package myfirstproject.

How to resolve it? Do I need to do something with environment variables. The PATH environment variable is already set to 'C:\Go\bin'.

When I click on the error message it asks me to configure GOPATH.

enter image description here


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!