Skip to content

Comments

Remove exhaustruct linter#4571

Closed
renaudhartert-db wants to merge 1 commit intomainfrom
remove-exhaustruct-linter
Closed

Remove exhaustruct linter#4571
renaudhartert-db wants to merge 1 commit intomainfrom
remove-exhaustruct-linter

Conversation

@renaudhartert-db
Copy link
Contributor

Summary

Removes the exhaustruct linter from the CI lint workflow.

Why

The exhaustruct linter requires every field in a struct literal to be explicitly initialized, even when the zero value is intentional. This goes against idiomatic Go, where leveraging zero values is a core language feature and a deliberate design choice.

The linter was scoped to bundle/direct/dresources to catch missing fields when constructing API resource structs. In practice, the Go compiler and tests already catch meaningful omissions, and the linter creates friction without proportional benefit — it forces boilerplate like Field: "" or Field: nil that adds noise without adding safety.

What changed

Interface changes

None.

Behavioral changes

None. The linter only ran in CI; removing it has no effect on the CLI's behavior.

Internal changes

  • Removed exhaustruct from the enable list in .golangci.yaml.
  • Removed the associated path-scoping rules in the exclusions section.

How is this tested?

make lintfull passes with 0 issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant