Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

The Dependency Rule, Written as a CI Check in Go

DEV Community·Gabriel Anhaia·about 1 month ago
#0U4YeShy
#option#go#architecture#ci#domain#fullscreen
Reading 0:00
15s threshold

Book: Hexagonal Architecture in Go Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub You wrote the architecture doc. The team agreed in the meeting. The PR description says "follows hexagonal." Six months later, you open internal/domain/order.go and the import block reads database/sql , net/http , and github.com/aws/aws-sdk-go-v2/service/s3 . Nobody noticed when those crept in. They rode in on a Friday afternoon merge, past two senior reviewers running on coffee. Architecture rules that live only in your head do not survive the second quarter of a service's life. The fix is to encode the rule the same way you encode any other invariant: as a check that fails the build. This post walks through three ways to do that for the hexagonal dependency rule (domain imports nothing from adapter/...…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More