Update a dependency to the latest version.

Section: Dependency Updates

Upgrade dependency

bash
bash
go get example.com/lib@latest
Explanation

Update a dependency to the latest version. Useful in Go CLI workflows.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Dependency Updates
Upgrade patch release
Update a dependency within its compatible patch/minor range.
OpenIn sheetbashsame section
List available updates
Show modules that have newer versions available.
OpenIn sheetbashsame section
Verify module cache
Verify dependencies in module cache against go.sum.
OpenIn sheetbashsame section
Exclude bad version
Exclude a dependency version from selection.
OpenIn sheetbashsame section
Initialize module
Create a new go.mod for the current project.
OpenIn sheetbash1 tag match
Add replace directive
Point a module dependency to a local checkout.
OpenIn sheetbash1 tag match