-
Notifications
You must be signed in to change notification settings - Fork 4
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
Initialize nil maps before setting key #67
Conversation
Previously, about half of the `Add*()` methods that set a value in a map checked if the map was nil before setting a field. Now they all do. Signed-off-by: Scott Andrews <scott@andrews.me>
cc @mamachanko |
Codecov Report
@@ Coverage Diff @@
## main #67 +/- ##
==========================================
- Coverage 10.58% 10.45% -0.13%
==========================================
Files 64 64
Lines 3024 3060 +36
==========================================
Hits 320 320
- Misses 2702 2738 +36
Partials 2 2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
LGTM! Checks out with our code.
@@ -41,6 +41,9 @@ type _ = corev1.LimitRangeItem | |||
|
|||
func (d *LimitRangeItemDie) AddMax(name corev1.ResourceName, quantity resource.Quantity) *LimitRangeItemDie { | |||
return d.DieStamp(func(r *corev1.LimitRangeItem) { | |||
if r.Max == nil { |
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 approve this change in particular.
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.
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.
All of them !
Previously, about half of the
Add*()
methods that set a value in a mapchecked if the map was nil before setting a field. Now they all do.
Resolves #66
Signed-off-by: Scott Andrews scott@andrews.me