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
+17.7k Golang : Upload/Receive file progress indicator
+15.1k Golang : Search folders for file recursively with wildcard support
+11.6k Swift : Convert (cast) Float to String
+36.7k Golang : Validate IP address
+4.8k Facebook : How to place save to Facebook button on your website
+27.5k Golang : Convert integer to binary, octal, hexadecimal and back to integer
+12.8k Golang : Add ASCII art to command line application launching process
+10.3k Golang : Text file editor (accept input from screen and save to file)
+21.6k Golang : How to read float value from standard input ?
+5.8k Linux : Disable and enable IPv4 forwarding
+7.2k Golang : Array mapping with Interface
+13.6k Golang : Read XML elements data with xml.CharData example