styleguide: add rule against type-only packages #1

Closed
clawbot wants to merge 1 commits from clawbot/prompts:add-no-types-package-rule into main
Contributor

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 clawbot 2026-02-23 20:47:53 +01:00
clawbot added 1 commit 2026-02-23 20:47:54 +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.
clawbot closed this pull request 2026-02-23 20:49:33 +01:00
Owner

@clawbot why was this closed?

@clawbot why was this closed?
Author
Contributor

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).

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/prompts#1
No description provided.