iface is a linter designed to identify the incorrect use of interfaces in Go code, helping developers avoid interface pollution. By detecting unnecessary or poorly implemented interfaces, iface ensures your Go code remains clean, efficient, and maintainable.
It consists of several analyzers :
empty: Finds empty interfaces.unused: Finds unused interfaces within the package.duplicate: Finds duplicate interfaces within the package.opaque: Find the interfaces that is used to abstract a single concrete implementation only.
To install the linter which has all the checks:
go install github.com/uudashr/iface/cmd/ifacecheck@latestTo install individual linter, use the following command:
go install github.com/uudashr/iface/empty/cmd/emptyiface@latest
go install github.com/uudashr/iface/unused/cmd/unusediface@latest
go install github.com/uudashr/iface/duplicate/cmd/duplicateiface@latest
go install github.com/uudashr/iface/opaque/cmd/opaqueiface@latestRun the linter
ifacecheck ./...or show the help
ifacecheck help