[GO] What should be the values of GOPATH and GOROOT?
https://stackoverflow.com/questions/7970390/what-should-be-the-values-of-gopath-and-goroot
GOPATH is discussed in the cmd/go documentation:TheGOPATHenvironment variable lists places to look for Go code. On Unix, the value is a colon-separated string. On Windows, the value is a semicolon-separated string. On Plan 9, the value is a list.GOPATHmust be set to get, build and install packages outside the standard Go tree.
GOROOT is discussed in the installation instructions:The Go binary distributions assume they will be installed in/usr/local/go(orc:\Gounder Windows), but it is possible to install the Go tools to a different location. In this case you must set theGOROOTenvironment variable to point to the directory in which it was installed.For example, if you installed Go to your home directory you should add the following commands to$HOME/.profile:export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/binNote:GOROOTmust be set only when installing to a custom location

Comments
Post a Comment