A Go linter that checks if errors from external packages are properly wrapped to improve debugging.
Wrapcheck is a Go linter that checks whether errors returned from external packages are properly wrapped with additional context. It solves the problem of ambiguous error origins during debugging by enforcing error wrapping at package boundaries, making it easier to trace where errors originate in complex applications.
Go developers working on applications that integrate multiple external libraries and need better error traceability, particularly those following Go 1.13+ error handling patterns.
Developers choose Wrapcheck because it automates enforcement of error wrapping best practices, integrates seamlessly with existing tools like golangci-lint, and provides configurable rules to adapt to different codebase requirements.
A Go linter to check that errors from external packages are wrapped
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Specifically flags unwrapped errors from external packages, addressing ambiguous error origins in logs, as shown in the README's example of sql errors without context.
Offers configurable ignore rules via YAML, including signatures, package globs, and regex patterns, allowing teams to tailor checks to their codebase.
Integrates directly with golangci-lint, enabling easy adoption in existing CI/CD pipelines without additional setup overhead.
Enforces Go 1.13+ error wrapping patterns, ensuring errors carry contextual information for easier tracing, as highlighted in the project's philosophy.
The README explicitly states that adding stack traces is out of scope, limiting error debugging depth compared to tools that include stack information.
The YAML setup with multiple ignore lists and regex patterns can be overwhelming, especially for beginners or teams with simple error handling needs.
By default, it only checks package boundary errors; internal error reporting requires explicit configuration, potentially missing intra-package issues.