Safeguard
Developer Tools•

How do you list outdated Go dependencies with go list -m -u all?

go list -m -u all shows each Go module in your build and the newer version available. Learn how to read it, parse it, and turn it into a patch routine.

Safeguard Security Team
3 min read

Run go list -m -u all. It prints every module in your build list and, in brackets after the current version, the newer version that is available. Use the JSON form for scripts. It tells you what is behind, not what is vulnerable, so pair it with an advisory check.

What the command prints

The go command documentation gives an example of this output: each line names a module, its current version, and a newer version in square brackets when one exists. For tooling, the same page suggests the JSON variant, go list -m -u -json all, is more convenient to parse.

The all pattern means the main module and its dependencies, including indirect ones, so you see the whole graph that the build uses. See what indirect means in go.mod.

Reading the output

  • A module with no bracket is at the newest version the proxy knows.
  • A module with a bracket has a newer release. It may be a patch, a minor or a major version, so look at the number.
  • Modules with a deprecated or retracted version may show extra notes. We cover those in finding deprecated modules and the retract directive.

From list to routine

StepCommand ideaPurpose
Inventorylist with the update flagSee what is behind
Check advisoriesgovulncheckSee what is known vulnerable
Update onego get with a versionMake a small, reviewable change
Verifygo build and testsCatch breakage
Tidygo mod tidyRemove unused requirements

Updating everything at once is hard to review. Prefer small steps, as in how to update Go dependencies safely.

Out of date is not the same as vulnerable

A module can be several versions behind and have no known issue. Another can be one patch behind and carry a serious one. Prioritise by advisory and by whether your code reaches the vulnerable function. We explain the Go approach in govulncheck reachability.

Making it a habit

Run the listing on a schedule and post only the changes to your team channel. Add the list to the pull request when a dependency changes, so reviewers see what else is available.

Safeguard's dependency scanning and reachability analysis cover Go modules, and the free scan at gold.safeguard.sh/scan shows your own results.

Try it yourself

Click through it at your own pace, or open it full screen.

Compare the full list of findings with the reachable ones, then ask which outdated modules you would update first.

Quick check

Does go list -m -u all check for vulnerabilities?

No. It reports available newer versions only. Use a vulnerability check for advisories.

How do I parse the output in a script?

Use the JSON form, go list -m -u -json all, which the documentation suggests for tools.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.