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
+12.4k Golang : "https://" not allowed in import path
+10.5k Golang : Resolve domain name to IP4 and IP6 addresses.
+14k Golang : Reverse IP address for reverse DNS lookup example
+5.1k Golang : Experimental Jawi programming language
+4.4k Java : Generate multiplication table example
+6k Golang : Grab news article text and use NLP to get each paragraph's sentences
+7.7k Golang : Reverse a string with unicode
+10k Golang : Test a slice of integers for odd and even numbers
+3.3k Golang : Fix go-cron set time not working issue
+16.3k Golang : Convert slice to array
+20.5k Android Studio : AlertDialog and EditText to get user string input example
+6k Golang : Dealing with backquote