go-gopath-get(1)

go-gopath-get1

Legacy gopath go get

Usage

go get [-d] [-f] [-t] [-u] [-v] [-fix] [build flags] [packages]

Overview

Get downloads the packages named by the import paths, along with their dependencies. It then installs the named packages, like 'go install'.

-d

The -d flag instructs get to stop after downloading the packages; that is, it instructs get not to install the packages.

-f

The -f flag, valid only when -u is set, forces get -u not to verify that each package has been checked out from the source control repository implied by its import path. This can be useful if the source is a local fork of the original.

-fix

The -fix flag instructs get to run the fix tool on the downloaded packages before resolving dependencies or building the code.

-t

The -t flag instructs get to also download the packages required to build the tests for the specified packages.

-u

The -u flag instructs get to use the network to update the named packages and their dependencies. By default, get uses the network to check out missing packages but does not use it to look for updates to existing packages.

-v

The -v flag enables verbose progress and debug output.

Get also accepts build flags to control the installation. See go-build(1).

When checking out a new package, get creates the target directory GOPATH/src/<import-path>. If the GOPATH contains multiple entries, get uses the first one. For more details see: 'go help gopath'.

When checking out or updating a package, get looks for a branch or tag that matches the locally installed version of Go. The most important rule is that if the local installation is running version "go1", get searches for a branch or tag named "go1". If no such version exists it retrieves the default branch of the package.

When go get checks out or updates a Git repository, it also updates any git submodules referenced by the repository.

Get never checks out or updates code stored in vendor directories.

For more about specifying packages, see go-packages(7).

For more about how 'go get' finds source code to download, see go-remote(7).

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

Author

This manual page was written by Michael Stapelberg <[email protected]> and is maintained by the Debian Go Compiler Team <[email protected]> based on the output of 'go help gopath-get' for the Debian project (and may be used by others).

From gccgo-go 2:1.24~2 in Debian 13 (Trixie). Also shipped by golang-go. Parsed by carta from the page's man source.