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
+36.2k Golang : Smarter Error Handling with strings.Contains()
+3.5k Golang : Fix go-cron set time not working issue
+14.1k Golang : How to determine if a year is leap year?
+7.9k Golang : Scan files for certain pattern and rename part of the files
+20.4k Golang : Compare floating-point numbers
+10.6k Golang : Simple Jawi(Yawi) to Rumi(Latin/Romanize) converter
+32.6k Golang : Math pow(the power of x^y) example
+9.7k Javascript : Read/parse JSON data from HTTP response
+14.1k Golang : Human readable time elapsed format such as 5 days ago
+12.5k Golang : Search and extract certain XML data example
+4.9k Which content-type(MIME type) to use for JSON data
+7.1k Golang : How to solve "too many .rsrc sections" error?