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
+5.2k Golang : Check if a word is countable or not
+11.4k Golang : How to determine a prime number?
+7.5k Golang : How to fix html/template : "somefile" is undefined error?
+11.1k Golang : Replace a parameter's value inside a configuration file example
+10.3k Golang : How to tokenize source code with text/scanner package?
+21.4k Golang : How to get time zone and load different time zone?
+22.9k Golang : Set and Get HTTP request headers example
+22.9k Generate checksum for a file in Go
+19.7k Golang : Example for DSA(Digital Signature Algorithm) package functions
+7.7k Golang : Hue, Saturation and Value(HSV) with OpenCV example
+8.5k Golang : Convert word to its plural form example
+12.2k Golang : Setup API server or gateway with Caddy and http.ListenAndServe() function example