Setting $GOPATH environment variable for Unix/Linux and Windows
Go relies on one important environment variable called $GOPATH to determine where is the workspace located in your computer. To setup the $GOPATH environment variable in your computer, use this command :
export GOPATH=/home/userid/goworkspace
now, of couse the /home/userid/goworkspace
is for my own and you have to set the correct path for your own computer.
For Windows, use the SET
command
set GOPATH=c:\goworkspace
again, the c:\goworkspace
is just an example. Change it according to your own preference.
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+24.4k Golang : How to validate URL the right way
+33.9k Golang : Proper way to set function argument default value
+6.3k Golang : Selection sort example
+17.8k Golang : Simple client server example
+6.6k Golang : Derive cryptographic key from passwords with Argon2
+6k nginx : force all pages to be SSL
+16.7k Golang : Read integer from file into array
+5.7k Unix/Linux : Get reboot history or check when was the last reboot date
+7.4k Golang : Get YouTube playlist
+33.9k Golang : Call a function after some delay(time.Sleep and Tick)
+6k Golang : Convert Chinese UTF8 characters to Pin Yin
+7.1k Golang : Use modern ciphers only in secure connection