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
+6.5k Golang : Dealing with postal or zip code example
+16.5k Golang : Defer function inside init()
+9.6k Golang : Allow Cross-Origin Resource Sharing request
+13.9k Golang : ROT47 (Caesar cipher by 47 characters) example
+4.5k Golang : Qt update UI elements with core.QCoreApplication_ProcessEvents
+18.6k Golang : Close channel after ticker stopped example
+2.8k Java : Get FX sentiment from website example
+6.5k Golang : File system scanning
+4.4k Golang : Pad file extension automagically
+15k Golang : Loop each day of the current month example
+19.9k Golang : Clean up null characters from input data
+7.4k Golang : Oanda bot with Telegram and RSI example