Find imports that should be replaced by alternative versions.
Motivation
There are many third-part libraries that are drop-in replacements for built-in imports. Some examples:
"github.com/pkg/errors" -> "errors"
log "github.com/sirupsen/logrus" -> "log"
This linter allows for a configurable input of the replacements you would like and allows enforcement of them via CI.
Get Started
go get github.com/kpurdon/altimports/cmd/altimports
altimports --replacement "errors:github.com/pkg/errors" ./...
The --replacement flag can be specified multiple times and is of the form {import_to_replace}:{import_to_use}. The flag can be specified 1 to many times to specify multiple replacements.