Skip to content

chore(deps): update module dev.gaijin.team/go/exhaustruct/v4 to v5#6

Closed
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/dev.gaijin.team-go-exhaustruct-v4-5.x
Closed

chore(deps): update module dev.gaijin.team/go/exhaustruct/v4 to v5#6
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/dev.gaijin.team-go-exhaustruct-v4-5.x

Conversation

@renovate
Copy link
Copy Markdown

@renovate renovate Bot commented May 19, 2026

This PR contains the following updates:

Package Change Age Confidence
dev.gaijin.team/go/exhaustruct/v4 v4.0.0v5.0.0 age confidence

Release Notes

GaijinEntertainment/go-exhaustruct (dev.gaijin.team/go/exhaustruct/v4)

v5.0.0

Compare Source

exhaustruct v5 reshapes how the linter is configured. Struct tags give way to comment directives, opt-in checking lands as a first-class mode, and patterns now reach down to individual fields. The full reference is in the README; this is the highlight reel.

What's new

Comment directives replace struct tags. Three directives — enforce, ignore, optional — now work at three levels of granularity: type definitions, struct literals, and individual fields. A documented priority order keeps the interaction between them predictable.

//exhaustruct:enforce
type Config struct {
    Host    string
    //exhaustruct:optional
    Timeout int
}

Explicit mode (-explicit) flips the default. Instead of checking every struct literal in the project, the linter only checks types you've explicitly marked — either with //exhaustruct:enforce or via -enforce-rx. The right pick for large codebases where exhaustruct should be a precision tool, not a blanket policy.

Field-level regex patterns. The pattern flags now accept Type#Field syntax, so a single configuration line can express optionality across a codebase without touching the type definitions:

.*\.Server#Timeout    # Timeout field in any Server type

Optional patterns (-optional-rx). Regex-based optionality for whole types or specific fields. Closes a long-standing gap for third-party types you can't annotate directly.

Derived types and aliases now follow a clearer rule. Field-level directives carry through type T = U and type T U — so a field marked optional stays optional on every alias and derived type. Type-level directives stay attached to the original type, which means you can promote a derived type to "enforced" independently.

Better diagnostics. -report-full-type-path reports net/http.Cookie instead of http.Cookie, removing ambiguity when import aliases are in play (#​146). -debug-cache-metrics prints per-package cache statistics, useful for tuning patterns on large projects.

Auto-migration. exhaustruct -fix ./... rewrites the legacy exhaustruct:"optional" tags to comment directives in one pass — no manual sweep required.

Breaking changes
  • Struct tags retired. exhaustruct:"optional" is no longer recognized. The -fix flag migrates existing tags automatically; the manual equivalent is a one-line move from the field's struct tag to a //exhaustruct:optional comment above (or beside) the field.
  • Flag rename. The old include/exclude vocabulary suggested filtering, but the linter has always been about enforcement. The new names say what they do:
    • -include-rx / -i-enforce-rx
    • -exclude-rx / -e-ignore-rx
  • Module path moves to /v5. Update imports and reinstall:
    go install dev.gaijin.team/go/exhaustruct/v5/cmd/exhaustruct@latest
Fixes
  • Implicit pointer composite literals (&T{} returned where the function signature expects *T) are now flagged — previously they slipped past the checker (#​147).
  • Aliased struct types resolve through types.Unalias so their fields are inspected even behind an alias chain (#​149).
Migrating from v4
  1. Update import paths from /v4 to /v5.
  2. Run exhaustruct -fix ./... to rewrite struct tags to comment directives.
  3. Replace -include-rx / -i with -enforce-rx, and -exclude-rx / -e with -ignore-rx in CI configs and .golangci.yaml.
  4. Optional: consider -explicit if you'd rather opt specific types into checking than opt the rest out.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 89ec8e20-8f4b-4041-8fbb-c6b79c52b347

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@flc1125 flc1125 closed this May 19, 2026
@renovate
Copy link
Copy Markdown
Author

renovate Bot commented May 19, 2026

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 5.x releases. But if you manually upgrade to 5.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate Bot deleted the renovate/dev.gaijin.team-go-exhaustruct-v4-5.x branch May 19, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant