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.9k Golang : Generate random Chinese, Japanese, Korean and other runes
+21.3k Golang : simulate tail -f or read last line from log file example
+9.2k Golang : How to profile or log time spend on execution?
+9.8k Golang : Delay or limit HTTP requests example
+9.7k Golang : Calculate Relative Strength Index(RSI) example
+14.7k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+4.9k Facebook : How to force facebook to scrape latest URL link data?
+6.2k Golang : Word limiter example
+44.1k Golang : Marshal and unmarshal json.RawMessage struct example
+31.1k Golang : Regular Expression for alphanumeric and underscore
+4.8k Golang : Struct field tags and what is their purpose?
+18.6k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it