Skip to content
Modcons is a CLI tool that inspects go.mod file for deprecated versions
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.
cli_tests
cmd/modcons
test_data
.gitignore
LICENSE
Makefile
README.md
go.mod
go.sum
modcons.go
modcons_test.go

README.md

modcons

Go Report Card

Modcons is a CLI tool that inspects go.mod files for deprecated versions according to a set of deprecation rules.

For example:

github.com/myles-mcdonnell/blondie v1.0.0>=v3.0.0         #whitelist range equal or more than v1 less than v3
github.com/myles-mcdonnell/blondie =v0.8.0,v0.9.3         #whitelist v0.8.0 and v0.9.3
github.com/myles-mcdonnell/blondie !v1.5.7>=v1.8.3        #blacklist range equal or more than v1.5.7 less than 1.8.3
github.com/myles-mcdonnell/blondie !=v2.5.0               #blacklist

Where is modcop?

This project was initially named modcop until it was brought to my attention than a similar tool had already taken this name, which you can find here https://github.com/rogpeppe/modcop

Install

The latest binaries for all supported operating systems are here

If you have Go tool installed you may also run:

go get -u github.com/go-tooling/modcons/...

Usage

Example CLI usage:

modcons --rulepath=http://my.domain.com/myrules.modcons --modpath=./go.mod --parseOnly=false
  • Note that both path args may be local or http(s) urls.
  • parseOnly will only parse the rule file and will not inspect the go.mod file
  • Both modpath and parseOnly flag are optional, the default values are shown above
  • If any deprecated references are identified modcons exits with code 1.
You can’t perform that action at this time.