finds.dev← search

// the find

fatih/faillint

★ 243 · Go · NOASSERTION · updated Mar 2025

Report unwanted import path and declaration usages

faillint is a small go/analysis-based linter that fails the build when specific import paths or exported identifiers, such as fmt.Errorf, are used. It is for teams that want to enforce house rules, like preferring github.com/pkg/errors over the standard errors package, in CI without writing a config file.

- Rules can target a single exported identifier, such as fmt.{Errorf}, instead of banning a whole package. That keeps each rule narrow enough that people are less likely to argue with it.

- It is built on go/analysis, so it runs like any other Go analyzer. Its file:line:col output is the format editors and CI already parse.

- Suppression uses the staticcheck-style //lint:ignore faillint form, so the escape hatch looks like every other Go lint exception and reviewers don't have to learn a new one.

- The motivating case is real. goimports will quietly pick the stdlib errors package over github.com/pkg/errors, and code like that compiles cleanly, so a human reviewer can easily miss it.

- Rules exist only as a comma-separated -paths flag with no config file. A project with twenty rules ends up with a long string in the CI YAML and nowhere to record why each rule exists.

- The last push was 2025-03-05, more than a year before today. For a tool that gates CI, check the issue tracker and recent Go version support before you pin it.

- The =suggestion is display text only. faillint reports the replacement but does not rewrite anything, so every flagged site is still a manual edit.

- Import-level rules are already covered by golangci-lint's depguard, and identifier-level rules by forbidigo, inside a linter most Go CI runs anyway. faillint only justifies its own binary if you want one tool for both cases with the {Func} syntax.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →