Skip to content

Conversation

@bernot-dev
Copy link
Collaborator

@bernot-dev bernot-dev commented Dec 2, 2025

Bump golangci-lint to 2.6.2.

The removals of omitempty in json struct tags have been verified by modernize to be ineffective. omitzero was not added to avoid behavior changes. Corresponding fields have been explicitly marked optional. This results in some updates to the documentation, but no changes to the CRDs themselves.

Instances of interface{} have been changed to any.

String formatting functions have been replaced when they do not use actual formatting placeholders.

TestMain implicitly calls os.Exit since 1.15.

The pattern of splitting and then iterating over the parts has been replaced with SplitSeq, which is more efficient.

@bernot-dev bernot-dev self-assigned this Dec 2, 2025
@bernot-dev bernot-dev force-pushed the golangci-lint-2.6.2 branch 2 times, most recently from 24f83f9 to ebd82b9 Compare December 3, 2025 18:01
Copy link
Collaborator

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Majority changes make sense, just few suggestions.

The removals of omitempty in json struct tags have been verified by modernize to be ineffective. omitzero was not added to avoid behavior changes. Corresponding fields have been explicitly marked optional. This results in some updates to the documentation, but no changes to the CRDs themselves.

Hm, are we sure about the modernize check? This is true for std json, but we don't use std json decoding but that yaml.v3 which does have a unique omitempty-almost-like-omitzero behaviour - https://pkg.go.dev/gopkg.in/yaml.v3#section-readme:~:text=Only%20include%20the%20field%20if%20it%27s%20not%20set%20to%20the%20zero

Notably zero value is omitted in our yaml parsing (also what k8s is using) (!), so I think this can potentially break things. Can we ignore that modernize rule just to be safe (unless we have time to test this thoroughly)?

@bernot-dev bernot-dev force-pushed the golangci-lint-2.6.2 branch 6 times, most recently from 2921510 to 290358b Compare January 23, 2026 19:10
@bernot-dev bernot-dev requested review from bwplotka and removed request for hsmatulis January 23, 2026 19:11
@bernot-dev bernot-dev force-pushed the golangci-lint-2.6.2 branch 3 times, most recently from 4569968 to 9e210e6 Compare January 23, 2026 20:19
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.

2 participants