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
+3.6k Linux/MacOSX : Search and delete files by extension
+3.7k MariaDB/MySQL : How to get version information
+12.1k Facebook PHP getUser() returns 0
+5.5k Golang : Find the longest line of text example
+7.3k Golang : How to check if input string is a word?
+11.3k Elastic Search : Return all records (higher than default 10)
+5k Golang : Experimenting with the Rejang script
+29.2k Golang : Interpolating or substituting variables in string examples
+9.9k Golang : Delay or limit HTTP requests example
+9.9k Golang : Characters limiter example
+5.5k Golang : Calculate diameter, circumference, area, sphere surface and volume
+12k Golang : Calculate elapsed years or months since a date