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
+5.6k Javascript : How to refresh page with JQuery ?
+17.7k Golang : Read data from config file and assign to variables
+5.1k Linux/Unix/MacOSX : Find out which application is listening to port 80 or use which IP version
+5.4k Golang : Qt update UI elements with core.QCoreApplication_ProcessEvents
+15.6k Golang : Convert date format and separator yyyy-mm-dd to dd-mm-yyyy
+7k Golang : How to call function inside template with template.FuncMap
+7.9k Golang Hello World Example
+15.3k Golang : Get all local users and print out their home directory, description and group id
+21.1k Golang : Sort and reverse sort a slice of strings
+7.9k Golang : Ways to recover memory during run time.
+5.6k PHP : Fix Call to undefined function curl_init() error
+4.4k Linux/MacOSX : Search and delete files by extension