A Go static analyzer that enforces conventions for projects built with
retrogolib.
- Retrogolib-aware checks - Finds issues that general-purpose Go linters do not cover
- Flexible targets - Analyzes files, directories, and Go package patterns such as
./... - Rule selection - Runs or disables individual rules and complete rule categories
- Configurable severity - Reports violations at or above the selected severity
- Targeted exclusions - Excludes tests, directories, and file patterns globally or per rule
- CI output - Produces concise text or structured JSON output
| Category | Checks |
|---|---|
| Logging | Message style, structured fields, logger use, and eager field evaluation |
| Testing | Manual assertions that can use retrogolib/assert |
| Collections | Map-based sets and inefficient retrogolib/set operations |
| Code quality | Function signature layout, declaration order, parameter order, parameter type grouping, and exported type names |
See the rule reference for rule details and examples.
Download a prebuilt binary from Releases, or install from source with Go 1.22 or later:
go install github.com/retroenv/retrogolint/cmd/retrogolint@latestAnalyze the current module:
retrogolint ./...Analyze a package tree:
retrogolint ./internal/compiler/...Output JSON for CI or tooling:
retrogolint -format json ./...Run only logging rules:
retrogolint -rules logging ./...Disable a rule or category:
retrogolint -disabled-rules collections-map-set ./...If no paths are provided, retrogolint analyzes ./....
retrogolint reads .retrogolint.ini by default. Command-line flags override
file settings. The configuration supports global exclusions and exclusions for
individual rules or rule categories.
See the configuration reference for all options and examples.