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.5k PHP : Convert CSV to JSON with YQL example
+7.9k Golang : Get all countries phone codes
+27.2k Golang : Convert CSV data to JSON format and save to file
+13.8k Golang : convert rune to unicode hexadecimal value and back to rune character
+15k Golang : Save(pipe) HTTP response into a file
+19.4k Golang : How to Set or Add Header http.ResponseWriter?
+7.7k Golang : Getting Echo framework StartAutoTLS to work
+12.3k Elastic Search : Return all records (higher than default 10)
+10.7k Golang : Natural string sorting example
+5.1k Responsive Google Adsense
+13.3k Golang : Read from buffered reader until specific number of bytes