go get在哪里存储下载的内容?

I have been informed to use go get <github-URL> to download a go program.

The command exists with no output and exit code 0.

On my system both $GOPATH and $GOROOT are unset.

Where did go store my downloaded program?

It stores in GOPATH. If you don't set it explicitly, it has default values (depending on your system).

https://golang.org/doc/code.html#GOPATH

The GOPATH environment variable specifies the location of your workspace. It defaults to a directory named go inside your home directory, so $HOME/go on Unix, $home/go on Plan 9, and %USERPROFILE%\go (usually C:\Users\YourName\go) on Windows.

This go language issue says that if the GOPATH environment variable is unset, then by default:

  • $HOME/go is used on *NIX
  • %USERPROFILE%\go is used on Windows