This repository was archived by the owner on Oct 24, 2023. It is now read-only.
style: remove unneeded nil check#1110
Merged
jackfrancis merged 2 commits intoAzure:masterfrom Apr 22, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1110 +/- ##
==========================================
- Coverage 74.35% 74.35% -0.01%
==========================================
Files 131 131
Lines 18274 18270 -4
==========================================
- Hits 13588 13584 -4
Misses 3905 3905
Partials 781 781 |
| } | ||
| // We use KubernetesConfig.EnableRbac to convert to versioned api model | ||
| // The assumption here is KubernetesConfig.EnableSecureKubelet is set to be same | ||
| if kc != nil && kc.EnableRbac != nil && *kc.EnableRbac { |
Contributor
There was a problem hiding this comment.
slight preference for removing the above check instead so we can have one return to.BoolPtr(false) instead of two.
Member
Author
There was a problem hiding this comment.
Or even better:
return to.BoolPtr(kc != nil && kc.EnableRbac != nil && *kc.EnableRbac)
Member
|
lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon, mboersma 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Reason for Change:
In master there is some (old) code that fails
govetwith golangci-lint v1.16.0. This removes a redundant nil check to satisfy it. Look at the code just above the diff to see why it's redundant.Issue Fixed:
Unblocks #1088
Requirements:
Notes:
I'm not sure how this made it into master without us noticing. The code hasn't been changed, and the linter version changed a while ago...