User Tools

Site Tools


ai:prompt:review-pr-golang

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
ai:prompt:review-pr-golang [2026/06/11 14:14] phong2018ai:prompt:review-pr-golang [2026/06/11 14:20] (current) phong2018
Line 101: Line 101:
  
 - [ ] Domain sentinel errors live in `domain/model/xxx_error.go` (e.g. `ErrTodoNotFound = errors.New(...)`). - [ ] Domain sentinel errors live in `domain/model/xxx_error.go` (e.g. `ErrTodoNotFound = errors.New(...)`).
-- [ ] Infrastructure returns domain sentinels — never `apperror` types directly (e.g. `sql.ErrNoRows` → `domainModel.ErrTodoNotFound`). 
 - [ ] Presentation middleware maps domain sentinels → HTTP codes via `errors.Is` / `errors.As` — this mapping lives only in middleware, never in usecase or infrastructure. - [ ] Presentation middleware maps domain sentinels → HTTP codes via `errors.Is` / `errors.As` — this mapping lives only in middleware, never in usecase or infrastructure.
 - [ ] `AppError.Err` (internal error) must never be serialized to the client response. - [ ] `AppError.Err` (internal error) must never be serialized to the client response.
-- [ ] No raw SQL errors, gRPC status codes, or stack traces in HTTP responses. 
  
 --- ---
Line 136: Line 134:
  
 - [ ] Define interfaces in the **consumer package**, not in the implementor's package. - [ ] Define interfaces in the **consumer package**, not in the implementor's package.
 +  - **Exception for this project:** `TodoRepository`, `NotificationClient`, `FileStorage` live in `domain/` because the consumer (usecase) depends on domain — this is intentional per the architecture, not a violation.
 - [ ] Keep interfaces minimal — only the methods the consumer actually calls. - [ ] Keep interfaces minimal — only the methods the consumer actually calls.
 - [ ] Flag any interface with 5+ methods as a potential fat interface violation. - [ ] Flag any interface with 5+ methods as a potential fat interface violation.
ai/prompt/review-pr-golang.1781187274.txt.gz · Last modified: by phong2018