A Go tool for enforcing architectural rules like dependencies, package contents, function properties, and naming conventions.
Arch-Go is a Go library and CLI tool that performs architectural checks on Go projects. It allows teams to define and enforce rules about dependencies, package contents, function properties, and naming conventions to maintain a clean, consistent codebase structure. It solves the problem of architectural drift by catching violations during development or CI/CD pipelines.
Go developers and teams working on medium to large codebases who need to enforce architectural boundaries, maintain layered designs, or adhere to internal coding standards.
Developers choose Arch-Go for its declarative YAML configuration, flexible glob-based package patterns, and seamless integration with Go's testing framework. Unlike general linters, it focuses specifically on architectural concerns, providing granular control over dependencies and package organization.
Architecture checks for 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.
Allows defining allowed and forbidden imports using glob patterns for internal, standard, and external packages, preventing unwanted dependencies between architectural layers as shown in the YAML configuration examples.
Enforces what types of declarations a package can contain, such as only interfaces or no structs, helping maintain clean separation of concerns through configurable content rules.
Provides a Go API to integrate architectural checks into standard go test workflows, making it easy to catch violations early in CI/CD pipelines, as demonstrated in the programmatic usage example.
Supports setting compliance and coverage rate thresholds to ensure rules are consistently applied, with defaults at 100% to enforce strict adherence across the codebase.
The README admits that coverage checks only verify if packages match patterns without deeply analyzing internal components like structs or methods, potentially missing subtle violations.
Defining rules for large projects can become verbose and error-prone due to reliance on glob patterns and YAML syntax, requiring significant upfront effort to set up correctly.
Lacks built-in IDE support or graphical interfaces, relying solely on command-line tools, which may slow down developer feedback compared to real-time linters.