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
+9.8k Golang : ROT47 (Caesar cipher by 47 characters) example
+12.3k Golang : How to shuffle elements in array or slice?
+5.5k Android Studio : AlertDialog to get user attention example
+13k Golang : Find out mime type from bytes in buffer
+6.8k Golang : Get SPF and DMARC from email headers to fight spam
+4.7k Golang : Skip or discard items of non-interest when iterating example
+6.8k Golang : Detect number of active displays and the display's resolution
+5.6k Golang : Gorrila mux.Vars() function example
+4.7k Golang : Extract sub-strings
+6.5k Golang : HTTP Server Example
+3.6k Golang *File points to a file or directory ?
+8k Golang : Fix go.exe is not compatible with the version of Windows you're running