Skip to content

Cloud / Examples / Go Clean Architecture

Go Clean Architecture

A widely used example of clean architecture in Go: HTTP handlers, use cases, and a MySQL repository.

Go bxcodec/go-clean-arch @ e06c6d0 · committed Mar 8, 2024 · analyzed Oct 25, 2026 · computed from the code, no AI

4flows traced across layers
4API routes
2data tables
1outside services
9runtime packages

How requests move through it

Each line follows one request from where it starts to where it ends. Click a file to open that exact line on GitHub.

  1. RouteGET /articlesarticle.go:44Coderest/article.goarticle.go:1
  2. RoutePOST /articlesarticle.go:45Coderest/article.goarticle.go:1
  3. RouteGET /articles/:paramarticle.go:46Coderest/article.goarticle.go:1
  4. RouteDELETE /articles/:paramarticle.go:47Coderest/article.goarticle.go:1

Data model

articleauthor

Technology

Nothing in the technology setup needs attention.

Runtime

Go 1.20Go modulesgo.sum

Outside services

  • MySQL database

Packages by role 9 runtime, 0 for development

Frameworksgithub.com/labstack/echo/v4v4.11.4
Data and storagegopkg.in/DATA-DOG/go-sqlmock.v1v1.3.0github.com/go-sql-driver/mysqlv1.7.1
Validationgopkg.in/go-playground/validator.v9v9.31.0
Monitoringgithub.com/sirupsen/logrusv1.9.3
Othergithub.com/joho/godotenvv1.5.1golang.org/x/syncv0.6.0

Security and AI-agent checks

0 critical · 0 high · 0 medium · 0 low. Includes checks of files AI coding agents read. 1 code-health note not shown here.

  • No critical, high, or medium security findings.
All 4 routes and pages

Limits of this report

  • "No imports found" means no import, script, or config mention was seen. A package can still be used another way, so confirm before removing it.
  • Static analysis reads the code; it does not run it. A missing flow means it could not be proven from the source, not that it does not exist.
  • Engine 2026-10-25.nextjs (0c1481d).

See your own repository like this