Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ iface Public

Linter to detects the overuse or misuse of interfaces in Go code AKA "Interface Pollution"

License

uudashr/iface

Repository files navigation

Go Reference

iface

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 :

  1. empty: Finds empty interfaces.
  2. unused: Finds unused interfaces within the package.
  3. duplicate: Finds duplicate interfaces within the package.
  4. opaque: Find the interfaces that is used to abstract a single concrete implementation only.

Usage

To install the linter which has all the checks:

go install github.com/uudashr/iface/cmd/ifacecheck@latest

To 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@latest

Run the linter

ifacecheck ./...

or show the help

ifacecheck help

Related Articles

About

Linter to detects the overuse or misuse of interfaces in Go code AKA "Interface Pollution"

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages