GO-GET(1)

πŸ’… NAME

go-get β€” bestie, this is the one that adds dependencies to your current module and installs them. ✨


🌸 SYNOPSIS

go get [-t] [-u] [-tool] [build flags] [packages]

πŸŽ€ DESCRIPTION

okay so Get takes whatever you typed on the command line, resolves those args to packages at specific module versions, updates go.mod so it requires those versions, and pulls the source code down into the module cache. That's the whole job. She's focused. πŸ‘‘

Wanna add a dependency for a package, or glow it up to its latest version? say less:

go get example.com/pkg

Wanna upgrade or downgrade a package to one specific version? we love a precise queen:

go get example.com/pkg@v1.2.3

Wanna remove a dependency on a module and downgrade the modules that require it? ok breaking up era:

go get example.com/mod@none

Wanna bump the minimum required Go version to the latest released Go version? periodt:

go get go@latest

Wanna upgrade the Go toolchain to the latest patch release of the current Go toolchain? so specific, so cute:

go get toolchain@patch

lowkey if you want the full lore, it's at https://go.dev/ref/mod#go-get πŸ¦‹


not me about to spill the backstory πŸ™ˆ β€” in earlier versions of Go, go get was used to build and install packages. Now? go get is dedicated to adjusting dependencies in go.mod. That's her whole personality now. If you actually wanna build and install commands, go install is the girl for that. And when a version is specified, go install runs in module-aware mode and ignores the go.mod file in the current directory. literally ignores it. iconic. for example:

go install example.com/pkg@v1.2.3
go install example.com/pkg@latest

See go help install or https://go.dev/ref/mod#go-install for details. πŸ’–


okay and go get accepts the following flags, so let's get into it ✨

  • -t β€” tells get to consider the modules needed to build tests of the packages you named on the command line. tests deserve love too 🫢
  • -u β€” tells get to update the modules providing dependencies of the packages named on the command line, using newer minor or patch releases when they're available. glow up window: open.
  • -u=patch β€” note the equals sign, bestie. not -u patch. this one also updates dependencies, but it changes the default so it picks patch releases. tiny change, big difference, iykyk πŸ’…
  • -tool β€” tells go to add a matching tool line to go.mod for each listed package. and if you use -tool together with @none, that line gets removed. gone. ghosted. See go help tool for more info.
  • -x β€” prints commands as they're executed. super useful for debugging version control commands when a module is downloaded directly from a repository. chef's kiss for detective mode πŸ”

and when you use -t and -u together, get will update test dependencies as well. duo. dream team. πŸ’œ

For more about build flags, see go help build.

For more about modules, see https://go.dev/ref/mod.

For more about using go get to update the minimum Go version and suggested Go toolchain, see https://go.dev/doc/toolchain.

For more about specifying packages, see go help packages.


πŸ¦‹ SEE ALSO


⭐ AUTHOR

This manual page was created using help2man and afterwards updating the output. It is maintained by the Debian Go Compiler Team <team+go-compiler@tracker.debian.org> for the Debian project (and may be used by others). respect the maintainers, they're doing the lord's work πŸ™


and that's the whole page, bestie πŸ’– this is from Go 1.27, dated August 2026, filed under GO-GET(1) β€” go forth and manage your dependencies responsibly, no cap πŸ‘‘βœ¨

πŸ“¦ where this page comes from