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
+11.1k Golang : Add ASCII art to command line application launching process
+6.3k Golang : How to stop user from directly running an executable file?
+25.2k Golang : Find files by extension
+5.1k Javascript : Get operating system and browser information
+7.7k Golang : Find network service name from given port and protocol
+12.6k Golang : unknown escape sequence error
+11.8k Golang : Convert IPv4 address to packed 32-bit binary format
+5.4k Golang : Convert an executable file into []byte example
+13.2k Golang : GUI with Qt and OpenCV to capture image from camera
+4.8k Golang : Error handling methods
+28.2k Golang : Login(Authenticate) with Facebook example
+22.7k Golang : Upload to S3 with official aws-sdk-go package