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
+15.9k Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type
+9.3k Golang : How to find out similarity between two strings with Jaro-Winkler Distance?
+15.7k Golang : How to convert(cast) IP address to string?
+8.6k PHP : How to parse ElasticSearch JSON ?
+11.6k Golang : Format numbers to nearest thousands such as kilos millions billions and trillions
+7.7k Golang : Dealing with struct's private part
+10.1k Golang : Channels and buffered channels examples
+7.2k Restart Apache or Nginx web server without password prompt
+10k Golang : Turn string or text file into slice example
+7.5k Golang : Gorrila set route name and get the current route name
+6.2k Golang : Build new URL for named or registered route with Gorilla webtoolkit example
+10k Golang : Sort and reverse sort a slice of integers