Comment on page
Start with Golang
- Go (1.7+)
go installcommand builds and installs the packages named by the paths on the command line. Executables (main packages) are installed to the directory named by the GOBIN environment variable, which defaults to
$HOME/go/binif the GOPATH environment variable is not set. Executables in
$GOROOTare installed in
$GOBIN. Non-executable packages are built and cached but not installed.
Since Go 1.16, if the arguments have version suffixes (like
@v1.0.0), go install builds packages in module-aware mode, ignoring the go.mod file in the current directory or any parent directory if there is one. This is useful for installing executables without affecting the dependencies of the main module.
go install github.com/prest/prest/cmd/prestd@latest