Find outdated dependencies of your Go projects. go-mod-outdated provides a table view of the go list -u -m -json all command which lists all dependencies of a Go project and their available minor and patch updates. It also provides a way to filter indirect dependencies and dependencies without updates.

Build Status codecov Go Report Card GoDoc

go-mod-outdated

An easy way to find outdated dependencies of your Go projects.

go-mod-outdated provides a table view of the go list -u -m -json all command which lists all dependencies of a Go project and their available minor and patch updates. It also provides a way to filter indirect dependencies and dependencies without updates.

In short it turns this:

{
	"Path": "github.com/BurntSushi/locker",
	"Version": "v0.0.0-20171006230638-a6e239ea1c69",
	"Time": "2017-10-06T23:06:38Z",
	"GoMod": "/home/mojo/go/pkg/mod/cache/download/github.com/!burnt!sushi/locker/@v/v0.0.0-20171006230638-a6e239ea1c69.mod"
}
{
	"Path": "github.com/BurntSushi/toml",
	"Version": "v0.0.0-20170626110600-a368813c5e64",
	"Time": "2017-06-26T11:06:00Z",
	"Update": {
		"Path": "github.com/BurntSushi/toml",
		"Version": "v0.3.1",
		"Time": "2018-08-15T10:47:33Z"
	},
	"GoMod": "/home/mojo/go/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.0.0-20170626110600-a368813c5e64.mod"
}

into this

+-------------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
|                  MODULE                   |               VERSION                |            NEW VERSION             | DIRECT | VALID TIMESTAMPS |
+-------------------------------------------+--------------------------------------+------------------------------------+--------+--------+---------+
| github.com/BurntSushi/locker              | v0.0.0-20171006230638-a6e239ea1c69   |                                    | true   | true             |
| github.com/BurntSushi/toml                | v0.0.0-20170626110600-a368813c5e64   | v0.3.1                             | true   | true             |
+-------------------------------------------+--------------------------------------+------------------------------------+--------+--------+---------+

Installation

go get -u github.com/psampaz/go-mod-outdated

Usage

In the folder where your go.mod lives run

go list -u -m -json all | go-mod-outdated

to see all modules in table view.

If you want to see only the modules with updates run

go list -u -m -json all | go-mod-outdated -update

If you want to see only the direct depedencies run

go list -u -m -json all | go-mod-outdated -direct

If you want to see only the direct depedencies that have updates run

go list -u -m -json all | go-mod-outdated -update -direct 

To output a markdown compatible table, pass the -style markdown option

go list -u -m -json all | go-mod-outdated -style markdown 

Important note for Go 1.14 users

If are using Go 1.14 with vendoring you need to pass -mod=mod or -mod=readonly to the go list command otherwise you will get the following error:

$ go list -u -m -json all
 
go list -m: can't determine available upgrades using the vendor directory
        (Use -mod=mod or -mod=readonly to bypass.)

The following will work:

 go list -u -m -mod=mod -json all | go-mod-outdated
 go list -u -m -mod=readonly -json all | go-mod-outdated

Docker

In the folder where your go.mod lives run

go list -u -m -json all | docker run -i psampaz/go-mod-outdated

To use parameters just append

go list -u -m -json all | docker run -i psampaz/go-mod-outdated -update

CI pipelines

Using the -ci flag will the make the command exit with none zero code, breaking this way your ci pipelines.

If you want to make your CI pipeline fail if any direct or indirect dependency is outdated use the following:

go list -u -m -json all | go-mod-outdated -ci

If you want to make your CI pipeline fail only if a direct dependency is outdated use the following:

go list -u -m -json all | go-mod-outdated -direct -ci

Help

In order to see details about the usage of the command use the -h or -help flag

$ go-mod-outdated -help

Usage of go-mod-outdated:
  -direct
        List only direct modules
  -update
        List only modules with updates
  -ci
        Non-zero exit code when at least one outdated dependency was found
  -style string
        Output style, pass 'markdown' for a Markdown table (default "default")

Shortcut

If go list -u -m -json all | go-mod-outdated -update -direct seems too difficult to use or remember you can create a shortcut using an alias. In linux try one of the following:

alias gmo="go list -u -m -json all | go-mod-outdated"

alias gmod="go list -u -m -json all | go-mod-outdated -direct"

alias gmou="go list -u -m -json all | go-mod-outdated -update"

alias gmodu="go list -u -m -json all | go-mod-outdated -direct -update"

Invalid timestamps

There is a case where the updated version reported by the go list command is actually older than the current one.

go-mod-outdated output includes a column named VALID TIMESTAMP which will give an indication when this case happens, helping application maintainers to avoid upgrading to a version that will break their application.

Important note

  • Upgrading an application is a responsibility of the maintainer of the application. Semantic versioning provides a way to indicate breaking changes, but still everything relies on each module developer to apply correct version tags. Unless there is a fully automated way to detect breaking changes in a codebase, a good practice to avoid surpises is to write tests and avoid dependencies on modules not well maintained and documented.

Supported Go versions

  • 1.13.x
  • 1.14.x
  • 1.15.x

Supported operating systems

  • linux
  • osx

Real Example

The following example is based on Hugo's go.mod (v0.53) (https://raw.githubusercontent.com/gohugoio/hugo/v0.53/go.mod)

Json output of go list -u -m json all command

$ go list -u -m -json all
{
	"Path": "github.com/gohugoio/hugo",
	"Main": true,
	"Dir": "/home/user/Code/go/hugo",
	"GoMod": "/home/user/Code/go/hugo/go.mod"
}
{
	"Path": "github.com/BurntSushi/locker",
	"Version": "v0.0.0-20171006230638-a6e239ea1c69",
	"Time": "2017-10-06T23:06:38Z",
	"GoMod": "/home/user/go/pkg/mod/cache/download/github.com/!burnt!sushi/locker/@v/v0.0.0-20171006230638-a6e239ea1c69.mod"
}
{
	"Path": "github.com/BurntSushi/toml",
	"Version": "v0.0.0-20170626110600-a368813c5e64",
	"Time": "2017-06-26T11:06:00Z",
	"Update": {
		"Path": "github.com/BurntSushi/toml",
		"Version": "v0.3.1",
		"Time": "2018-08-15T10:47:33Z"
	},
	"GoMod": "/home/user/go/pkg/mod/cache/download/github.com/!burnt!sushi/toml/@v/v0.0.0-20170626110600-a368813c5e64.mod"
}

{
	"Path": "golang.org/x/crypto",
	"Version": "v0.0.0-20181203042331-505ab145d0a9",
	"Time": "2018-12-03T04:23:31Z",
	"Update": {
		"Path": "golang.org/x/crypto",
		"Version": "v0.0.0-20190418165655-df01cb2cc480",
		"Time": "2019-04-18T16:56:55Z"
	},
	"Indirect": true,
	"GoMod": "/home/user/go/pkg/mod/cache/download/golang.org/x/crypto/@v/v0.0.0-20181203042331-505ab145d0a9.mod"
}
{
	"Path": "golang.org/x/image",
	"Version": "v0.0.0-20180708004352-c73c2afc3b81",
	"Time": "2018-07-08T00:43:52Z",
	"Update": {
		"Path": "golang.org/x/image",
		"Version": "v0.0.0-20190417020941-4e30a6eb7d9a",
		"Time": "2019-04-17T02:09:41Z"
	},
	"Dir": "/home/user/go/pkg/mod/golang.org/x/[email protected]",
	"GoMod": "/home/user/go/pkg/mod/cache/download/golang.org/x/image/@v/v0.0.0-20180708004352-c73c2afc3b81.mod"
}
....
....
....
....
{
	"Path": "golang.org/x/net",
	"Version": "v0.0.0-20180906233101-161cd47e91fd",
	"Time": "2018-09-06T23:31:01Z",
	"Update": {
		"Path": "golang.org/x/net",
		"Version": "v0.0.0-20190420063019-afa5a82059c6",
		"Time": "2019-04-20T06:30:19Z"
	},
	"Indirect": true,
	"GoMod": "/home/user/go/pkg/mod/cache/download/golang.org/x/net/@v/v0.0.0-20180906233101-161cd47e91fd.mod"
}
{
	"Path": "golang.org/x/text",
	"Version": "v0.3.0",
	"Time": "2017-12-14T13:08:43Z",
	"GoMod": "/home/user/go/pkg/mod/cache/download/golang.org/x/text/@v/v0.3.0.mod"
}
{
	"Path": "gopkg.in/check.v1",
	"Version": "v1.0.0-20180628173108-788fd7840127",
	"Time": "2018-06-28T17:31:08Z",
	"Indirect": true,
	"GoMod": "/home/user/go/pkg/mod/cache/download/gopkg.in/check.v1/@v/v1.0.0-20180628173108-788fd7840127.mod"
}
{
	"Path": "gopkg.in/yaml.v2",
	"Version": "v2.2.2",
	"Time": "2018-11-15T11:05:04Z",
	"GoMod": "/home/user/go/pkg/mod/cache/download/gopkg.in/yaml.v2/@v/v2.2.2.mod"
}

Table view of go list -u -m -json all command using go-mod-outdated

$ go list -u -m -json all | go-mod-outdated
+-------------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
|                  MODULE                   |               VERSION                |            NEW VERSION             | DIRECT | VALID TIMESTAMPS |
+-------------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
| github.com/BurntSushi/locker              | v0.0.0-20171006230638-a6e239ea1c69   |                                    | true   | true             |
| github.com/BurntSushi/toml                | v0.0.0-20170626110600-a368813c5e64   | v0.3.1                             | true   | true             |
| github.com/PuerkitoBio/purell             | v1.1.0                               | v1.1.1                             | true   | true             |
| github.com/PuerkitoBio/urlesc             | v0.0.0-20170810143723-de5bf2ad4578   |                                    | false  | true             |
| github.com/alecthomas/assert              | v0.0.0-20170929043011-405dbfeb8e38   |                                    | true   | true             |
| github.com/alecthomas/chroma              | v0.6.0                               | v0.6.3                             | true   | true             |
| github.com/alecthomas/colour              | v0.0.0-20160524082231-60882d9e2721   |                                    | false  | true             |
| github.com/alecthomas/repr                | v0.0.0-20180818092828-117648cd9897   | v0.0.0-20181024024818-d37bc2a10ba1 | false  | true             |
| github.com/armon/consul-api               | v0.0.0-20180202201655-eb2c6b5be1b6   |                                    | false  | true             |
| github.com/bep/debounce                   | v1.1.0                               | v1.2.0                             | true   | true             |
| github.com/bep/gitmap                     | v1.0.0                               |                                    | true   | true             |
| github.com/bep/go-tocss                   | v0.6.0                               |                                    | true   | true             |
| github.com/chaseadamsio/goorgeous         | v1.1.0                               |                                    | true   | true             |
| github.com/cheekybits/is                  | v0.0.0-20150225183255-68e9c0620927   |                                    | false  | true             |
| github.com/coreos/etcd                    | v3.3.10+incompatible                 | v3.3.12+incompatible               | false  | true             |
| github.com/coreos/go-etcd                 | v2.0.0+incompatible                  |                                    | false  | true             |
| github.com/coreos/go-semver               | v0.2.0                               | v0.3.0                             | false  | true             |
| github.com/cpuguy83/go-md2man             | v1.0.8                               | v1.0.10                            | false  | true             |
| github.com/danwakefield/fnmatch           | v0.0.0-20160403171240-cbb64ac3d964   |                                    | false  | true             |
| github.com/davecgh/go-spew                | v1.1.1                               |                                    | false  | true             |
| github.com/disintegration/imaging         | v1.5.0                               | v1.6.0                             | true   | true             |
| github.com/dlclark/regexp2                | v1.1.6                               |                                    | false  | true             |
| github.com/dustin/go-humanize             | v1.0.0                               |                                    | false  | true             |
| github.com/eknkc/amber                    | v0.0.0-20171010120322-cdade1c07385   |                                    | true   | true             |
| github.com/fortytw2/leaktest              | v1.2.0                               | v1.3.0                             | true   | true             |
| github.com/fsnotify/fsnotify              | v1.4.7                               |                                    | true   | true             |
| github.com/gobwas/glob                    | v0.2.3                               |                                    | true   | true             |
| github.com/gorilla/websocket              | v1.4.0                               |                                    | true   | true             |
| github.com/hashicorp/go-immutable-radix   | v1.0.0                               |                                    | true   | true             |
| github.com/hashicorp/go-uuid              | v1.0.0                               | v1.0.1                             | false  | true             |
| github.com/hashicorp/golang-lru           | v0.5.0                               | v0.5.1                             | false  | true             |
| github.com/hashicorp/hcl                  | v1.0.0                               |                                    | false  | true             |
| github.com/inconshreveable/mousetrap      | v1.0.0                               |                                    | false  | true             |
| github.com/jdkato/prose                   | v1.1.0                               |                                    | true   | true             |
| github.com/kr/pretty                      | v0.1.0                               |                                    | false  | true             |
| github.com/kr/pty                         | v1.1.1                               | v1.1.4                             | false  | true             |
| github.com/kr/text                        | v0.1.0                               |                                    | false  | true             |
| github.com/kyokomi/emoji                  | v1.5.1                               | v2.1.0+incompatible                | true   | true             |
| github.com/magefile/mage                  | v1.4.0                               | v1.8.0                             | true   | true             |
| github.com/magiconair/properties          | v1.8.0                               |                                    | false  | true             |
| github.com/markbates/inflect              | v0.0.0-20171215194931-a12c3aec81a6   | v1.0.4                             | true   | true             |
| github.com/matryer/try                    | v0.0.0-20161228173917-9ac251b645a2   |                                    | false  | true             |
| github.com/mattn/go-isatty                | v0.0.4                               | v0.0.7                             | true   | true             |
| github.com/mattn/go-runewidth             | v0.0.3                               | v0.0.4                             | false  | true             |
| github.com/miekg/mmark                    | v1.3.6                               |                                    | true   | true             |
| github.com/mitchellh/hashstructure        | v1.0.0                               |                                    | true   | true             |
| github.com/mitchellh/mapstructure         | v1.1.2                               |                                    | true   | true             |
| github.com/muesli/smartcrop               | v0.0.0-20180228075044-f6ebaa786a12   | v0.3.0                             | true   | true             |
| github.com/nfnt/resize                    | v0.0.0-20180221191011-83c6a9932646   |                                    | false  | true             |
| github.com/nicksnyder/go-i18n             | v1.10.0                              |                                    | true   | true             |
| github.com/olekukonko/tablewriter         | v0.0.0-20180506121414-d4647c9c7a84   | v0.0.1                             | true   | true             |
| github.com/pelletier/go-toml              | v1.2.0                               | v1.3.0                             | false  | true             |
| github.com/pkg/errors                     | v0.8.0                               | v0.8.1                             | true   | true             |
| github.com/pmezard/go-difflib             | v1.0.0                               |                                    | false  | true             |
| github.com/russross/blackfriday           | v0.0.0-20180804101149-46c73eb196ba   | v2.0.0+incompatible                | true   | false            |
| github.com/sanity-io/litter               | v1.1.0                               |                                    | true   | true             |
| github.com/sergi/go-diff                  | v1.0.0                               |                                    | false  | true             |
| github.com/shurcooL/sanitized_anchor_name | v0.0.0-20170918181015-86672fcb3f95   | v1.0.0                             | false  | true             |
| github.com/spf13/afero                    | v1.2.0                               | v1.2.2                             | true   | true             |
| github.com/spf13/cast                     | v1.3.0                               |                                    | true   | true             |
| github.com/spf13/cobra                    | v0.0.3                               |                                    | true   | true             |
| github.com/spf13/fsync                    | v0.0.0-20170320142552-12a01e648f05   |                                    | true   | true             |
| github.com/spf13/jwalterweatherman        | v1.0.1-0.20181028145347-94f6ae3ed3bc | v1.1.0                             | true   | true             |
| github.com/spf13/nitro                    | v0.0.0-20131003134307-24d7ef30a12d   |                                    | true   | true             |
| github.com/spf13/pflag                    | v1.0.3                               |                                    | true   | true             |
| github.com/spf13/viper                    | v1.3.1                               | v1.3.2                             | true   | true             |
| github.com/stretchr/testify               | v1.2.3-0.20181014000028-04af85275a5c | v1.3.0                             | true   | true             |
| github.com/tdewolff/minify/v2             | v2.3.7                               | v2.4.0                             | true   | true             |
| github.com/tdewolff/parse/v2              | v2.3.5                               | v2.3.6                             | false  | true             |
| github.com/tdewolff/test                  | v1.0.0                               |                                    | false  | true             |
| github.com/ugorji/go/codec                | v0.0.0-20181204163529-d75b2dcb6bc8   |                                    | false  | true             |
| github.com/wellington/go-libsass          | v0.9.3-0.20181113175235-c63644206701 | v0.9.2                             | false  | false            |
| github.com/xordataexchange/crypt          | v0.0.3-0.20170626215501-b2862e3d0a77 | v0.0.2                             | false  | false            |
| github.com/yosssi/ace                     | v0.0.5                               |                                    | true   | true             |
| golang.org/x/crypto                       | v0.0.0-20181203042331-505ab145d0a9   | v0.0.0-20190418165655-df01cb2cc480 | false  | true             |
| golang.org/x/image                        | v0.0.0-20180708004352-c73c2afc3b81   | v0.0.0-20190417020941-4e30a6eb7d9a | true   | true             |
| golang.org/x/net                          | v0.0.0-20180906233101-161cd47e91fd   | v0.0.0-20190420063019-afa5a82059c6 | false  | true             |
| golang.org/x/sync                         | v0.0.0-20180314180146-1d60e4601c6f   | v0.0.0-20190412183630-56d357773e84 | true   | true             |
| golang.org/x/sys                          | v0.0.0-20181206074257-70b957f3b65e   | v0.0.0-20190419153524-e8e3143a4f4a | false  | true             |
| golang.org/x/text                         | v0.3.0                               |                                    | true   | true             |
| gopkg.in/check.v1                         | v1.0.0-20180628173108-788fd7840127   |                                    | false  | true             |
| gopkg.in/yaml.v2                          | v2.2.2                               |                                    | true   | true             |
+-------------------------------------------+--------------------------------------+------------------------------------+--------+------------------+

Table view of go list -u -m -json all command using go-mod-outdated (only dependencies with updates)

$ go list -u -m -json all | go-mod-outdated -update
+-------------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
|                  MODULE                   |               VERSION                |            NEW VERSION             | DIRECT | VALID TIMESTAMPS |
+-------------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
| github.com/BurntSushi/toml                | v0.0.0-20170626110600-a368813c5e64   | v0.3.1                             | true   | true             |
| github.com/PuerkitoBio/purell             | v1.1.0                               | v1.1.1                             | true   | true             |
| github.com/alecthomas/chroma              | v0.6.0                               | v0.6.3                             | true   | true             |
| github.com/alecthomas/repr                | v0.0.0-20180818092828-117648cd9897   | v0.0.0-20181024024818-d37bc2a10ba1 | false  | true             |
| github.com/bep/debounce                   | v1.1.0                               | v1.2.0                             | true   | true             |
| github.com/coreos/etcd                    | v3.3.10+incompatible                 | v3.3.12+incompatible               | false  | true             |
| github.com/coreos/go-semver               | v0.2.0                               | v0.3.0                             | false  | true             |
| github.com/cpuguy83/go-md2man             | v1.0.8                               | v1.0.10                            | false  | true             |
| github.com/disintegration/imaging         | v1.5.0                               | v1.6.0                             | true   | true             |
| github.com/fortytw2/leaktest              | v1.2.0                               | v1.3.0                             | true   | true             |
| github.com/hashicorp/go-uuid              | v1.0.0                               | v1.0.1                             | false  | true             |
| github.com/hashicorp/golang-lru           | v0.5.0                               | v0.5.1                             | false  | true             |
| github.com/kr/pty                         | v1.1.1                               | v1.1.4                             | false  | true             |
| github.com/kyokomi/emoji                  | v1.5.1                               | v2.1.0+incompatible                | true   | true             |
| github.com/magefile/mage                  | v1.4.0                               | v1.8.0                             | true   | true             |
| github.com/markbates/inflect              | v0.0.0-20171215194931-a12c3aec81a6   | v1.0.4                             | true   | true             |
| github.com/mattn/go-isatty                | v0.0.4                               | v0.0.7                             | true   | true             |
| github.com/mattn/go-runewidth             | v0.0.3                               | v0.0.4                             | false  | true             |
| github.com/muesli/smartcrop               | v0.0.0-20180228075044-f6ebaa786a12   | v0.3.0                             | true   | true             |
| github.com/olekukonko/tablewriter         | v0.0.0-20180506121414-d4647c9c7a84   | v0.0.1                             | true   | true             |
| github.com/pelletier/go-toml              | v1.2.0                               | v1.3.0                             | false  | true             |
| github.com/pkg/errors                     | v0.8.0                               | v0.8.1                             | true   | true             |
| github.com/russross/blackfriday           | v0.0.0-20180804101149-46c73eb196ba   | v2.0.0+incompatible                | true   | false            |
| github.com/shurcooL/sanitized_anchor_name | v0.0.0-20170918181015-86672fcb3f95   | v1.0.0                             | false  | true             |
| github.com/spf13/afero                    | v1.2.0                               | v1.2.2                             | true   | true             |
| github.com/spf13/jwalterweatherman        | v1.0.1-0.20181028145347-94f6ae3ed3bc | v1.1.0                             | true   | true             |
| github.com/spf13/viper                    | v1.3.1                               | v1.3.2                             | true   | true             |
| github.com/stretchr/testify               | v1.2.3-0.20181014000028-04af85275a5c | v1.3.0                             | true   | true             |
| github.com/tdewolff/minify/v2             | v2.3.7                               | v2.4.0                             | true   | true             |
| github.com/tdewolff/parse/v2              | v2.3.5                               | v2.3.6                             | false  | true             |
| github.com/wellington/go-libsass          | v0.9.3-0.20181113175235-c63644206701 | v0.9.2                             | false  | false            |
| github.com/xordataexchange/crypt          | v0.0.3-0.20170626215501-b2862e3d0a77 | v0.0.2                             | false  | false            |
| golang.org/x/crypto                       | v0.0.0-20181203042331-505ab145d0a9   | v0.0.0-20190418165655-df01cb2cc480 | false  | true             |
| golang.org/x/image                        | v0.0.0-20180708004352-c73c2afc3b81   | v0.0.0-20190417020941-4e30a6eb7d9a | true   | true             |
| golang.org/x/net                          | v0.0.0-20180906233101-161cd47e91fd   | v0.0.0-20190420063019-afa5a82059c6 | false  | true             |
| golang.org/x/sync                         | v0.0.0-20180314180146-1d60e4601c6f   | v0.0.0-20190412183630-56d357773e84 | true   | true             |
| golang.org/x/sys                          | v0.0.0-20181206074257-70b957f3b65e   | v0.0.0-20190419153524-e8e3143a4f4a | false  | true             |
+-------------------------------------------+--------------------------------------+------------------------------------+--------+------------------+

Table view of go list -u -m -json all command using go-mod-outdated (only direct dependencies with updates)

$ go list -u -m -json all | go-mod-outdated -update -direct
+------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
|               MODULE               |               VERSION                |            NEW VERSION             | DIRECT | VALID TIMESTAMPS |
+------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
| github.com/BurntSushi/toml         | v0.0.0-20170626110600-a368813c5e64   | v0.3.1                             | true   | true             |
| github.com/PuerkitoBio/purell      | v1.1.0                               | v1.1.1                             | true   | true             |
| github.com/alecthomas/chroma       | v0.6.0                               | v0.6.3                             | true   | true             |
| github.com/bep/debounce            | v1.1.0                               | v1.2.0                             | true   | true             |
| github.com/disintegration/imaging  | v1.5.0                               | v1.6.0                             | true   | true             |
| github.com/fortytw2/leaktest       | v1.2.0                               | v1.3.0                             | true   | true             |
| github.com/kyokomi/emoji           | v1.5.1                               | v2.1.0+incompatible                | true   | true             |
| github.com/magefile/mage           | v1.4.0                               | v1.8.0                             | true   | true             |
| github.com/markbates/inflect       | v0.0.0-20171215194931-a12c3aec81a6   | v1.0.4                             | true   | true             |
| github.com/mattn/go-isatty         | v0.0.4                               | v0.0.7                             | true   | true             |
| github.com/muesli/smartcrop        | v0.0.0-20180228075044-f6ebaa786a12   | v0.3.0                             | true   | true             |
| github.com/olekukonko/tablewriter  | v0.0.0-20180506121414-d4647c9c7a84   | v0.0.1                             | true   | true             |
| github.com/pkg/errors              | v0.8.0                               | v0.8.1                             | true   | true             |
| github.com/russross/blackfriday    | v0.0.0-20180804101149-46c73eb196ba   | v2.0.0+incompatible                | true   | false            |
| github.com/spf13/afero             | v1.2.0                               | v1.2.2                             | true   | true             |
| github.com/spf13/jwalterweatherman | v1.0.1-0.20181028145347-94f6ae3ed3bc | v1.1.0                             | true   | true             |
| github.com/spf13/viper             | v1.3.1                               | v1.3.2                             | true   | true             |
| github.com/stretchr/testify        | v1.2.3-0.20181014000028-04af85275a5c | v1.3.0                             | true   | true             |
| github.com/tdewolff/minify/v2      | v2.3.7                               | v2.4.0                             | true   | true             |
| golang.org/x/image                 | v0.0.0-20180708004352-c73c2afc3b81   | v0.0.0-20190417020941-4e30a6eb7d9a | true   | true             |
| golang.org/x/sync                  | v0.0.0-20180314180146-1d60e4601c6f   | v0.0.0-20190412183630-56d357773e84 | true   | true             |
+------------------------------------+--------------------------------------+------------------------------------+--------+------------------+

Table view of go list -u -m -json all command using go-mod-outdated (with -ci flag, only direct dependencies with updates)

$ go list -u -m -json all | go-mod-outdated -update -direct -ci
+------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
|               MODULE               |               VERSION                |            NEW VERSION             | DIRECT | VALID TIMESTAMPS |
+------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
| github.com/BurntSushi/toml         | v0.0.0-20170626110600-a368813c5e64   | v0.3.1                             | true   | true             |
| github.com/PuerkitoBio/purell      | v1.1.0                               | v1.1.1                             | true   | true             |
| github.com/alecthomas/chroma       | v0.6.0                               | v0.6.3                             | true   | true             |
...
| golang.org/x/sync                  | v0.0.0-20180314180146-1d60e4601c6f   | v0.0.0-20190412183630-56d357773e84 | true   | true             |
+------------------------------------+--------------------------------------+------------------------------------+--------+------------------+
$ echo $?
1
Comments
  • Add style parameter and markdown output support

    Add style parameter and markdown output support

    Hi,

    Came across go-mod-outdated today and thought: Great idea!

    Immediately tried it on our own Go project and wanted to post its results into our internal Gitlab Wiki (which supports Markdown syntax and tables).

    This made me think, wouldn't it be nice if go-mod-outdated would support markdown compatible table output... I've added a -markdown flag in this pull request.

    Not sure if it would be better to have a general -style parameter to pass a output style argument, for example:

    go-mod-outdated -style <default|markdown|pretty>`
    

    pretty could be a coloured table output.

    Let me know what you think and if you would want to support something like that.

    Thanks for this great tool.

    tsak

  • Skip rendering the table if there are no updates to display

    Skip rendering the table if there are no updates to display

    In my usecase I'd like to only see output if there is an update to perform. This change skips running the table rendering if the filtered modules is an empty slice.

  • "New version" isn't always newer

    Great tool!

    I notice in your examples that the "New version" isn't always newer than the version/revision on the left. I understand why it is so, but I think it is a little misleading -- as you would think that by updating to that version you will include the features in the left version.

  • use as a package

    use as a package

    It would be nice if you could use the functionality inside of another application

    all that would be required to make this happen is to remove or rename the internal directory.

  • go-mod-outdated returns empty table

    go-mod-outdated returns empty table

    $ go list -mod=mod -u -m -json all | go-mod-outdated
    
    go: downloading github.com/Azure/azure-sdk-for-go v0.2.0-beta
    go: downloading github.com/oracle/oci-go-sdk v1.8.0
    go list -m: loading module retractions for github.com/coreos/[email protected]: no matching versions for query "latest"
    go list -m: loading module retractions for gopkg.in/[email protected]: version "v1.5.3" invalid: go.mod has non-....v1 module path "github.com/go-asn1-ber/asn1-ber" at revision v1.5.3
    go list -m: loading module retractions for gopkg.in/cheggaaa/[email protected]: version "v1.0.29" invalid: go.mod has non-....v1 module path "github.com/cheggaaa/pb" at revision v1.0.29
    go list -m: loading module retractions for gopkg.in/[email protected]: version "v1.4.9" invalid: go.mod has non-....v1 module path "github.com/fsnotify/fsnotify" at revision v1.4.9
    +--------+---------+-------------+--------+------------------+
    | MODULE | VERSION | NEW VERSION | DIRECT | VALID TIMESTAMPS |
    +--------+---------+-------------+--------+------------------+
    +--------+---------+-------------+--------+------------------+
    

    I downloaded at latest commit da89f8c52af9b057a0fc0ad53560ae16becf7207

    Any ideas? ๐Ÿ˜‡

  • Prompt like npm-check

    Prompt like npm-check

    I love this tool. Thank you very much.

    It would be amazing to have a prompt, something like https://github.com/dylang/npm-check:

    image

    So I can choose what to update.

  • Possibly wrong output on

    Possibly wrong output on "private" dependency

    It seems that in my case go-mod-outdated recommends an older version:

    $ go list -u -m -json all 2>/dev/null | go-mod-outdated -update -direct
    +-------------------------+--------------------------------------+-------------+--------+------------------+
    |          MODULE         |               VERSION                | NEW VERSION | DIRECT | VALID TIMESTAMPS |
    +-------------------------+--------------------------------------+-------------+--------+------------------+
    | some.private.dependency | v0.1.1-0.20190429140155-8759a946d40b | v0.1.0      | true   | false            |
    +-------------------------+--------------------------------------+-------------+--------+------------------+
    

    The repository for the dependency is private.

    Am I missing something here ?

    Thanks !

    • go version go1.12 linux/amd64
    • go-mod-outdated: v0.3.0
  • Allow programmatic use

    Allow programmatic use

    Hi,

    First of all, thank you for your tool! I have following two issues when using go-mod-outdated -update -direct.

    1. Exit code is always zero, regardless of updates were found. There is no way to distinguish between updates found or not.

    2. Empty table is shown when no updates were found.

    +--------+---------+-------------+--------+------------------+
    | MODULE | VERSION | NEW VERSION | DIRECT | VALID TIMESTAMPS |
    +--------+---------+-------------+--------+------------------+
    +--------+---------+-------------+--------+------------------+
    

    Is it possible to e.g. return -1 if nothing was found?

  • list outdated modules with same Minor version (so see patch update only)

    list outdated modules with same Minor version (so see patch update only)

    Hello

    Currently, I am not able to list new version of module but for patch only.

    For example:

    module github.com/test/test
    
    go 1.15
    
    require go.mongodb.org/mongo-driver v1.3.6
    

    I want to know if a new patch version if available (here v1.3.7 and not v1.4.0), but I don't know how to do. The given example here https://github.com/golang/go/wiki/Modules#how-to-upgrade-and-downgrade-dependencies is for direct with minor and patch (I just want patch). And yet, the v1.3.7 has been released (https://pkg.go.dev/mod/go.mongodb.org/[email protected]).

    $ go list -u -m all | grep "go.mongodb.org/mongo-driver"
    go.mongodb.org/mongo-driver v1.3.6 [v1.4.0]
    

    I want use this in my CI with psampaz/go-mod-outdated from @psampaz but only for patch version with something like (with option -patch & use go list -versions) :

    go list -versions -u -m -json all | go-mod-outdated -update -direct -style markdown -ci -patch
    

    related to golang/go#40990

  • Does it support golang >= 1.17?

    Does it support golang >= 1.17?

    I confirmed through README.md that go-mod-outdated currently supports golang 1.14, 1.15, and 1.16. But, the test(GitHub Action) seems to be running on golang 1.17, so what version can go-mod-outdated support exactly?

    Also, It seems that the field of Golang's 'Module Public' structure has been added since 1.16, so is it not necessary to reflect it?

  • zsh: command not found: go-mod-outdated

    zsh: command not found: go-mod-outdated

    When i do go get -u github.com/psampaz/go-mod-outdated and then go list -u -m -json all | go-mod-outdated I get zsh: command not found: go-mod-outdated

  • Allow to output JSON

    Allow to output JSON

    This adds a new output style, json, that outputs the same JSON that the tool ingests as its input, allowing it to work as a "filter" of sorts and enabling people to visualize the result the way they like it.

  • Enhance workflow

    Enhance workflow

    @psampaz First of all thank you for this great project! Really useful!

    As a modest gift, here is a PR that offers some enhancements for the current workflow:

    • Use buildx bake and goreleaser
    • Create artifacts with artifact (current platform) or artifact-all target for cross-compilation:
      • darwin/amd64
      • darwin/arm64
      • linux/amd64
      • linux/arm/v6
      • linux/arm/v7
      • linux/arm64
      • windows/amd64
    • Sandboxed vendor and lint validation with bake targets
    • Fix go.sum
    • Mutualize tests and handle them through bake and GitHub Actions with coverage
    • Update codecov/codecov-action to v2
    • Support Docker multi-platform image
    • GitHub Actions
      • On git push tag event semver like v0.9.0:
        • Artifacts will be available in the pipeline through actions/upload-artifact
        • Will create the GitHub Release and push artifacts
        • Will create and push Docker tags psampaz/go-mod-outdated:0.9.0 / psampaz/go-mod-outdated:latest
      • On git push (master branch)
        • Artifacts will be available in the pipeline through actions/upload-artifact
        • Will push Docker tag psampaz/go-mod-outdated:edge
      • On git pull_request event

    Everything is already in place and tested on https://github.com/crazy-max/go-mod-outdated as well as the GitHub Actions pipeline if you want to take a look.

    image

    https://github.com/crazy-max/go-mod-outdated/releases/tag/v0.9.0

    image

    https://hub.docker.com/r/crazymax/go-mod-outdated/tags?page=1&ordering=last_updated

  • Enable users to choose outdated dependency exit code

    Enable users to choose outdated dependency exit code

    Currently, when this job fails in a CI job with an exit code of one, it's difficult to programmatically tell the difference between an outdated dependency and a failure caused by another reason.

    This feature called --issues-exit-code, exists on golangci lint: https://golangci-lint.run/usage/configuration/ for example.

list or create gitlab project level variables for gitops

intro gitlab ci requires some env variables, for diffent projects these env vars may be same. so we have this cmd tool -- gitlab-vars install simplely

Dec 1, 2021
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.

Clean Architecture checker for Golang go-cleanarch was created to keep Clean Architecture rules, like a The Dependency Rule and interaction between mo

Dec 31, 2022
Find in Go repeated strings that could be replaced by a constant

goconst Find repeated strings that could be replaced by a constant. Motivation There are obvious benefits to using constants instead of repeating stri

Jan 3, 2023
PlantUML Class Diagram Generator for golang projects
PlantUML Class Diagram Generator for golang projects

GoPlantUML PlantUML Class Diagram Generator for golang projects. Generates class diagram text compatible with plantuml with the information of all str

Dec 31, 2022
dont-interface calculates how many interface{} are declared or used in your project?

dont-interface calculates how many interface{} are declared or used in your project?

Jun 9, 2022
A GitLab API client enabling Go programs to interact with GitLab in a simple and uniform way

go-gitlab A GitLab API client enabling Go programs to interact with GitLab in a simple and uniform way NOTE Release v0.6.0 (released on 25-08-2017) no

Jan 6, 2023
Manage your repository's TODOs, tickets and checklists as config in your codebase.

tickgit ??๏ธ tickgit is a tool to help you manage latent work in a codebase. Use the tickgit command to view pending tasks, progress reports, completio

Dec 30, 2022
Go linter which checks for dangerous unicode character sequences

bidichk - checks for dangerous unicode character sequences bidichk finds dangerous unicode character sequences in Go source files. Considered dangerou

Oct 5, 2022
Jenkins tracer is used to record all the Jenkins job environment variables and metrics, and send them to Elasticsearch

Jenkins Tracer Jenkins tracer is used to record all the jenkins job variables like record the build duration, build variables, repository metadata, et

Apr 22, 2021
Print all source code for a given go package or module.

gosrcs gosrcs is a tool to print all the source code a given go package depends on. The original motivation of this tool is to integrate go builds int

Oct 25, 2021
Go linter that checks types that are json encoded - reports unsupported types and unnecessary error checks

Checks types passed to the json encoding functions. Reports unsupported types and reports occations, where the check for the returned error can be omited.

Oct 7, 2022
apicompat checks recent changes to a Go project for backwards incompatible changes

Introduction apicompat is a tool to check for the introduction of backwards incompatible changes. apicompat: Guarantees that all consumers of a librar

Dec 24, 2022
Tool to populate your code with traceable and secure error codes

Essential part of any project, especially customer facing is proper and secure error handling. When error happens and customer reports it, it would be nice to know the context of the error and where it exactly occured.

Sep 28, 2022
This static analysis tool works to ensure your program's data flow does not spill beyond its banks.

Go Flow Levee This static analysis tool works to ensure your program's data flow does not spill beyond its banks. An input program's data flow is expl

Dec 1, 2022
A report card for your Go application
A report card for your Go application

Go Report Card A web application that generates a report on the quality of an open source go project. It uses several measures, including gofmt, go ve

Jan 6, 2023
๐Ÿ”’๐ŸŒ Security scanner for your Terraform code
๐Ÿ”’๐ŸŒ Security scanner for your Terraform code

????tfsec uses static analysis of your terraform templates to spot potential security issues.

Dec 30, 2022
Know when GC runs from inside your golang code

gcnotifier gcnotifier provides a way to receive notifications after every run of the garbage collector (GC). Knowing when GC runs is useful to instruc

Dec 26, 2022
Drone Plugin for detecting credentials or other sensitive data in your repository

A plugin to detect hard-coded secrets and sensitive data in your source code files. Building Build the plugin binary: scripts/build.sh Build the plug

Apr 21, 2022