diff --git a/prompts/CODE_STYLEGUIDE_GO.md b/prompts/CODE_STYLEGUIDE_GO.md index f859589..4cc8e93 100644 --- a/prompts/CODE_STYLEGUIDE_GO.md +++ b/prompts/CODE_STYLEGUIDE_GO.md @@ -227,6 +227,14 @@ last_modified: 2026-02-22 } ``` +1. Do not create packages just to hold types (e.g. `types`, `domain`, + `models` that contain only type definitions). Define types alongside the + implementations that use them. A type-only package is a sign that the types + are in the wrong place — move them to the package that actually operates on + them. This also avoids awkward import aliases (e.g. + `domaintypes "myapp/internal/domain"`) which are a code smell indicating + poor package naming. + 1. Define your struct types near their constructors. 1. Define your interface types near the functions that use them, or if you have