English
Replacing PostgreSQL or HTTP touches business code everywhere.
” and start asking “which responsibility should own this?
If you can delete Gin tomorrow and keep the use cases, the design is healthy.
go 3 internal/ 4 domain/ 5 user.
go 10 adapters/ 11 postgres/user_repo.
= nil { writeError ( w , err ) return } w .
Email ) { return ErrInvalidEmail } exists , err := uc .
NewUserRepository ( db ) uc := usecase .
Start () Postgres DB UserRepository RegisterUser Rule of thumb: create dependencies at startup, pass them inward, and never instantiate infrastructure from inside business logic.
Confidence to refactor internals without touching adapters.