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
+10.4k How to tell if a binary(executable) file or web application is built with Golang?
+9.1k Golang : cannot assign type int to value (type uint8) in range error
+8.2k Golang : Changing a RGBA image number of channels with OpenCV
+15.9k Golang : How to save log messages to file?
+5.6k Golang : Check if password length meet the requirement
+13.9k Golang : rune literal not terminated error
+6.4k Golang : Command line ticker to show work in progress
+6.8k Golang : Check from web if Go application is running or not
+6.5k Golang : Convert(cast) io.Reader type to string
+12.7k Golang : Get current time
+15.2k Golang : Get the IPv4 and IPv6 addresses for a specific network interface
+7.7k Golang : Get final balance from bit coin address example