What I do
Create new features with proper Clean Architecture separation:
- •Domain: entities, validation, pure business logic
- •Usecase: application logic, orchestration
- •Infra: HTTP handlers, database implementations
When to use me
Adding new domains, features, or resources to the API.
Pattern
File structure per feature:
code
internal/
domain/<feature>.go
app/usecase/<feature>/
create.go, update.go, delete.go, get.go
infra/handler/<feature>_create.go
infra/gorm/<feature>.go
infra/memory/<feature>.go
Rules
- •Domain has NO external dependencies
- •Usecases accept interfaces for dependencies
- •Handlers only handle HTTP concerns
- •Always create interface + constructor pattern