$GOROOT vs $GOPATH

What is $GOROOT and $GOPATH?

Answer

  1. $GOROOT is the root directory for standard library, including executables, source code and docs.
  2. $GOPATH is the directory for 3rd party packages.