finds.dev← search

// the find

sklinkert/go-ddd

★ 567 · Go · MIT · updated Jun 2026

Opinionated Domain Driven Design Template for Go

A Go project template for domain-driven design with CQRS, implementing a marketplace example with Sellers and Products. It demonstrates the full onion architecture stack: domain entities, application services, sqlc-generated repositories, and Echo REST handlers. Aimed at Go developers who want a working reference before building their own DDD service from scratch.

The sqlc + golang-migrate combo is the right call — type-safe queries without an ORM and explicit schema versioning in the same repo. Testcontainers integration tests hit a real Postgres instance, not mocks, so repository tests actually catch SQL bugs. The validated entity pattern (ValidatedProduct/ValidatedSeller wrapper types) enforces that only domain-validated objects reach the write path — hard to accidentally bypass. Idempotency key support is built into the command handlers, not bolted on later.

The domain layer only has two aggregates and they never interact meaningfully — a Seller owns Products but there's no business rule that exercises that relationship, so the 'cross-module interactions' the README promises aren't really there. No event sourcing or domain events at all; commands mutate state directly, which means eventual consistency patterns you'd actually need in a real DDD system are entirely absent. The CQRS split is cosmetic: reads and writes hit the same Postgres schema with no read model separation, so you get the complexity of the pattern without any of the scaling or modeling benefits. Vendor directory is committed, which is fine for reproducibility but means the repo is ~4MB of dependency files for a tiny example.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →