Skip to content
Update outdated Go dependencies interactively
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes Initial commit Jan 29, 2020
.gitignore Use goreleaser to release new versions Jan 31, 2020
.goreleaser.yml Build on Windows Jan 31, 2020
.travis.yml Add Travis CI Jan 31, 2020
License
Makefile goreleaser: remove dist before publishing Jan 31, 2020
go.mod Fix terminal overflows bug Jan 29, 2020
go.sum Initial commit Jan 29, 2020
main.go Lint code with golangci-lint Jan 31, 2020
readme.md Fix typos (#3) Feb 14, 2020
screenshot.png Initial commit Jan 29, 2020

readme.md

go-mod-upgrade

Build Status License Release

Update outdated Go dependencies interactively

Screenshot

Note that only patch and minor updates are supported for now.

Why

The Go wiki has a great section on How to Upgrade and Downgrade Dependencies. One can run the command

go list -u -f '{{if (and (not (or .Main .Indirect)) .Update)}}{{.Path}}: {{.Version}} -> {{.Update.Version}}{{end}}' -m all 2> /dev/null

to view available upgrades for direct dependencies. Unfortunately, the output is not actionable, i.e. we can't easily use it to update multiple dependencies.

This tool is an attempt to make it easier to update multiple dependencies interactively. This is similar to yarn upgrade-interactive, but for Go.

Install

Pre-compiled binaries for Windows, OS X and Linux are available in the releases page.

Alternatively, with the Go toolchain, you can do

$ go get -u github.com/oligot/go-mod-upgrade

Usage

In a Go project which uses modules, you can now run

$ go-mod-upgrade

Colors in module names help identify the update type:

  • green for a minor update
  • yellow for a patch update
  • red for a prerelease update
You can’t perform that action at this time.