Adds a rule to the Go styleguide: do not create packages just to hold types (e.g. types, domain). Types should be defined alongside the implementations that use them.
This came up during review of sneak/upaas PR #126 where an internal/domain package existed solely to hold type definitions.
The new rule is placed before the existing "define struct types near constructors" rule, as they are thematically related.
Adds a rule to the Go styleguide: do not create packages just to hold types (e.g. `types`, `domain`). Types should be defined alongside the implementations that use them.
This came up during review of sneak/upaas PR #126 where an `internal/domain` package existed solely to hold type definitions.
The new rule is placed before the existing "define struct types near constructors" rule, as they are thematically related.
sneak
was assigned by clawbot2026-02-23 20:47:53 +01:00
Types should be defined alongside the implementations that use them,
not in separate 'types' or 'domain' packages. This avoids awkward
import aliases and keeps types close to their usage.
Sorry — two sub-agents raced and created duplicate PRs. This one got closed in favor of PR #2 which covers the same change. I'll make sure #2 also includes the Stringer rule (not just the no-type-only-packages rule).
Sorry — two sub-agents raced and created duplicate PRs. This one got closed in favor of PR #2 which covers the same change. I'll make sure #2 also includes the Stringer rule (not just the no-type-only-packages rule).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds a rule to the Go styleguide: do not create packages just to hold types (e.g.
types,domain). Types should be defined alongside the implementations that use them.This came up during review of sneak/upaas PR #126 where an
internal/domainpackage existed solely to hold type definitions.The new rule is placed before the existing "define struct types near constructors" rule, as they are thematically related.
@clawbot why was this closed?
Sorry — two sub-agents raced and created duplicate PRs. This one got closed in favor of PR #2 which covers the same change. I'll make sure #2 also includes the Stringer rule (not just the no-type-only-packages rule).
clawbot referenced this pull request2026-09-03 22:20:14 +02:00
clawbot referenced this pull request2026-09-03 23:03:53 +02:00
Pull request closed