A Go tool that validates Clean Architecture rules like The Dependency Rule and module interactions in Go projects.
go-cleanarch is a static analysis tool for Go that enforces Clean Architecture principles by validating imports between layers. It ensures proper layer separation and dependency direction, helping maintain a testable, framework-independent codebase. The tool automates compliance with rules like The Dependency Rule to keep business logic decoupled from external frameworks and databases.
Go developers and teams building or maintaining large-scale applications where maintainability, testability, and adherence to Clean Architecture are priorities. It is particularly useful for projects requiring strict separation between domain, application, interfaces, and infrastructure layers.
Developers choose go-cleanarch for its automated enforcement of Clean Architecture, which reduces manual code review overhead and prevents architectural drift. Its unique selling points include customizable layer names, flexible ignore options for tests or packages, and CI/CD integration via exit code reporting.
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enforces The Dependency Rule by validating imports between layers, reducing manual code review effort for Clean Architecture compliance.
Supports custom aliases for domain, application, interfaces, and infrastructure layers via command-line flags, as shown in the LayersAliases mapping.
Returns exit code 1 for invalid architecture and 0 for valid, enabling easy integration into CI/CD pipelines for automated checks.
Allows ignoring test files with -ignore-tests or specific packages with -ignore-package flags, useful for testing without violating architecture rules.
The README admits it was only tested on Linux and probably doesn't work well on Windows, which can hinder adoption in mixed-OS teams.
Assumes specific GOPATH-based directory structures, which may not align with modern Go modules or custom project layouts, limiting flexibility.
Solely enforces Clean Architecture without support for other patterns, making it unsuitable for projects using hybrid or different architectural approaches.