Where do Go packages installed with `go get` reside?

Barbara Streisand
Release: 2024-11-13 15:59:02
Original
861 people have browsed it

Where do Go packages installed with `go get` reside?

Determining the Installation Location of Packages Obtained via Go Get

Question:

When using the go get command to install packages from remote Git repositories, it's not immediately clear where the package is installed. This question poses the issue, particularly in the absence of a defined GOPATH environment variable.

Answer:

To determine the installation location, consult the Homebrew formula for Go using the brew info go command. According to the information provided by the formula, a valid GOPATH is necessary for go get. If GOPATH is not explicitly defined, it defaults to $HOME/go.

To locate the executable installed by go get, navigate to the $HOME/go/bin directory. This is where the executable should be located.

The above is the detailed content of Where do Go packages installed with `go get` reside?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template