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.5k Golang : Removes punctuation or defined delimiter from the user's input
+16.1k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+8.7k Golang : io.Reader causing panic: runtime error: invalid memory address or nil pointer dereference
+11.8k Golang : Pagination with go-paginator configuration example
+23.9k Golang : How to validate URL the right way
+11.3k Golang : Change date format to yyyy-mm-dd
+10.8k Golang : Fix - does not implement sort.Interface (missing Len method)
+7.1k Golang : Process json data with Jason package
+4.8k Golang : Convert lines of string into list for delete and insert operation
+6.6k Mac OSX : Find large files by size
+5.9k Golang : Calculate US Dollar Index (DXY)
+4.7k Golang : Calculate a pip value and distance to target profit example