Skip to content
CAI
Software that uses CAICheck a score

hdlopez/clean-architecture-golang

58.7

Adequate · 8 November 2026

282

lines of production code

Go

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This is a Go-based application implementing clean architecture principles, structured around a message domain. It exposes a REST API with ping and message endpoints, utilizing a modular design that separates concerns into API, service, and repository layers. The system manages external HTTP communication through a centralized REST client and enforces structured error handling throughout the stack.

Features

Add config module for REST client initialization

A new config module has been introduced, providing a centralized way to initialize and manage REST clients using the go-resty library. The module defines a constant for the message API client and a function to return a map of configured REST clients, allowing for future expansion to include timeouts and retry strategies for additional APIs.

config · medium confidence

Added REST client for message API with error handling

The restclient module now includes a new MessageAPI interface and implementation that wraps the go-resty HTTP client to fetch messages by ID. The change introduces a base restAPI struct that handles HTTP GET requests, parses JSON responses, and returns structured API errors for non-200 status codes or unmarshal failures. A corresponding test suite validates successful retrieval and error scenarios against a mock server.

restclient · high confidence

Initial implementation of the message domain layer

The message package introduces the core domain logic for handling messages. This includes a Message entity, a repository layer that fetches data from an external API client, and a service layer that enforces business rules (such as validating that the message ID is not empty). A corresponding test file was also added to verify the service's Get method under both success and error conditions.

message · high confidence

Initial release of the Go clean architecture example

The repository is initialized with a complete Go application structure based on clean architecture principles. This includes the main entry point (main.go) that wires up dependency injection for the API, message service, and repository layers. The project also includes configuration for linting (golangci-lint), a Makefile for running tests and the application, and a README explaining the architecture and usage. Additionally, standard repository files like .gitignore and CODE\_OF\_CONDUCT.md are added.

(repo-wide) · high confidence

Introduce API layer with message and ping controllers

The API package now includes a new API struct that manages route configuration for /ping and /messages/:id endpoints. The message controller has been updated to handle HTTP status codes and error responses more explicitly, distinguishing between known API errors and unexpected internal server errors. Additionally, a ping controller has been added to handle the /ping endpoint. The changes also include a new test file for the message controller, which verifies the correct handling of success, bad request, and internal server error scenarios.

api · high confidence

Introduce structured API error handling

Adds a new \apierror\ package that defines an \APIError\ struct containing a status code and a message. This provides a standardized way to represent API errors with specific HTTP status codes and descriptive messages, implementing the standard \error\ interface and a custom \Code()\ method for status code retrieval.

apierror · high confidence

Dependencies

Initial Go module and dependency manifest

The project now includes a go.mod and go.sum file, establishing the Go module path (github.com/hdlopez/clean-architecture-golang) and declaring dependencies such as gin v1.8.1, resty v2.7.0, and golang.org/x/text v0.3.8. This enables the project to be built and managed using standard Go tooling.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 59 (+0.2)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 58 → 58 (+0.0)
  • Readiness 47 → 47 (+0.0)
  • Security 86 → 88 (+2.0)

Findings

  • No change — the same findings as the prior survey.

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

hdlopez/clean-architecture-golang was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 8 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 2c8f0098e6cad1f9dc74cea659ad1589466c36de — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.