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
+41.2k Golang : Convert string to array/slice
+27.2k Golang : Convert integer to binary, octal, hexadecimal and back to integer
+12.4k Golang : Pass database connection to function called from another package and HTTP Handler
+34.8k Golang : Upload and download file to/from AWS S3
+27.2k PHP : Convert(cast) string to bigInt
+13.2k Golang : Get constant name from value
+9.3k Golang : Changing a RGBA image number of channels with OpenCV
+11.5k Golang : Verify Linux user password again before executing a program example
+31.3k Golang : How to convert(cast) string to IP address?
+29.1k Golang : How to create new XML file ?
+10.4k Golang : Interfacing with PayPal's IPN(Instant Payment Notification) example