-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Before branching day: step 4 #3212
Before branching day: step 4 #3212
Conversation
return nil | ||
} | ||
|
||
func setMapIfNil[T any](x *map[string]T, y map[string]T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a go idiomatic approach. I am not sure what you are trying to achieve here, but there should be an easier way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have factored this code out:
// m is a map of type map[string]T, where T is any
if m == nil {
m = make(map[string]T)
}
that would be have otherwise replicated at least three times.
Happy to change it if you know a more idiomatic approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the place you are defining the map you should create it instead. Then there will be no need to do this check. Also, you can just do the if nil then make it
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've defined them right after releaseConfig := ReleaseConfig{}
, thanks!
return nil | ||
} | ||
|
||
func (b *ReleaseControllerConfigBumper) Marshall(releaseConfig *ReleaseConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the name of this method is not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you're right, even if marshalling
is allowed as well, check here. Changing that would mean to modify files that are not strictly related with the purpose of this PR, I'm planning to open another one.
31ee67c
to
9b7b0a1
Compare
@danilo-gemoli: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danilo-gemoli, droslean The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is a tool that tries to automate the fourth step of phase "Before branching day" .
Check Centralized Release Branching and Config Management V3
/cc @jmguzik @droslean