LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

go-get

download and manage Go package dependencies

TLDR

Download package
$ go get [github.com/pkg/errors]
copy
Download specific version
$ go get [github.com/pkg/errors@v0.9.1]
copy
Update package
$ go get -u [package]
copy
Download all dependencies
$ go get ./...
copy
Install binary
$ go install [github.com/user/tool@latest]
copy

SYNOPSIS

go get [options] [packages]

DESCRIPTION

go get downloads and installs packages and dependencies. In module mode, it updates go.mod and go.sum files to track dependencies. For installing tool binaries, use go install instead.The command resolves versions from module proxies, supporting semantic versioning. It can target specific versions, branches, or commits.

PARAMETERS

PACKAGES

Packages to download.
-u
Update to latest version.
-d
Download only, don't install (default behavior since Go 1.16; the flag is now a deprecated no-op).
-t
Include test dependencies.
@ VERSION
Specify version.
--help
Display help information.

INSTALL

sudo apt install gccgo-go
copy
sudo dnf install gcc-go
copy
sudo pacman -S gcc-go
copy
sudo apk add gcc-go
copy
sudo zypper install gcc-go
copy
brew install go
copy
nix profile install nixpkgs#go
copy

CAVEATS

Since Go 1.18, go get no longer builds or installs packages; it only edits go.mod/go.sum and populates the module cache. Running it outside a module, or to install a command, fails with an error pointing to go install. Updates modify go.mod and go.sum, which should be committed.

HISTORY

go get is part of the Go toolchain. Its build/install functionality was split off into go install in Go 1.17-1.18 as part of the modules transition, leaving go get focused solely on dependency resolution.

SEE ALSO

go(1), go-mod(1), go-install(1)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid