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
+7.5k Golang : Progress bar with ∎ character
+5.8k Golang : Fixing Gorilla mux http.FileServer() 404 problem
+13.1k Golang : Reset buffer example
+5.2k Golang : Create new color from command line parameters
+13.7k Golang : Get HTTP protocol version example
+7.1k Golang : HTTP Server Example
+6.3k Golang : Dealing with postal or zip code example
+81.3k Golang : How to convert character to ASCII and back
+6k Golang : Squaring elements in array
+5.8k Golang : Pat multiplexer routing example
+10.6k Golang : How to detect a server/machine network interface capabilities?
+5.7k Golang : Check if password length meet the requirement