Merged
Conversation
On-behalf-of: @SAP christoph.mewes@sap.com
Member
|
/lgtm |
Contributor
|
LGTM label has been added. DetailsGit tree hash: 14fdc28a17a374b93f5c7ec01e41fae5ed1ad057 |
Contributor
Author
|
/approve |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ntnn, xrstf The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I ran into issues when running
make lintwith Go 1.26 installed. Suddenly golangci-lint would just panic with an error saying that Go 1.26 would be required. It's confusing because none of the files in this repo require Go 1.26. 🤷Unfortunately, the new version of golangci-lint produces a lot of .... less than helpful prealloc messages:
And I have a few things to say about these.
1element... come on, linter, just think one more step ahead. If we really wanted to have a 1-element slice, what good is the slice? That is to say, if we actually begin to hardcodeconditions := make([]condition, 0, 1), then the entire reconciler is hardcoded to expect 1 condition only. So why would we even use a slice here? On the other hand, if we ever add more conditions, I would bet few people (not including me) would even remember to look at themake()call and adjust it accordingly. Having a slice be pre-allocated to 1 element is just IMHO pure nonsense.1 + len(secretMounts): Every code change in that reconciler would break the preallocation and require more changes.If there was an option on the linter to prevent it from complaining about this sort of stuff, I would love to keep the linter enabled. But in its current form, I fear that AI-driven folks will just blindly follow the recommendations and create hard-to-extend, easy-to-break code, just for the sake of PeRfOrMaNcE (let's not even discuss the real world performance implications of dealing with a massive ... 6-element slice in Go... just think of the nanoseconds we could be saving here!).
What Type of PR Is This?
/kind chore
Release Notes