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
+7.6k Golang : Load DSA public key from file example
+15.2k Golang : Force download file example
+5.2k Python : Delay with time.sleep() function example
+10.7k Golang : Replace a parameter's value inside a configuration file example
+7.1k Linux : How to fix Brother HL-1110 printing blank page problem
+5.8k PHP : How to check if an array is empty ?
+7.8k Golang : Get all countries phone codes
+30.7k Golang : Calculate percentage change of two values
+5.2k How to check with curl if my website or the asset is gzipped ?
+36.1k Golang : Convert date or time stamp from string to time.Time type
+5.3k Golang : If else example and common mistake