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

README.md

modcop

Go Report Card

Modcop 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

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/modcop/...

Usage

Example CLI usage:

modcop --rulepath=http://my.domain.com/myrules.modcop --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 modcop exits with code 1.
You can’t perform that action at this time.