Home >Backend Development >Golang >Where Do Packages Installed by `go get` Go?
Locating Packages Installed by go get
When running go get
According to the Go documentation, packages are expected to be installed in $GOPATH/bin. However, if $GOPATH is not set, Go will default to $HOME/go as the installation directory.
To verify this behavior, you can check the output of brew info go, which confirms the use of $HOME/go if $GOPATH is not defined. This explains why the go get command works even though $GOPATH is not explicitly set in your shell environment.
Consequently, the executable in question can be found in $HOME/go/bin. This is also where you will find any other executables installed using go get.
The above is the detailed content of Where Do Packages Installed by `go get` Go?. For more information, please follow other related articles on the PHP Chinese website!