-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: boolean logic #98
Conversation
Codecov Report
@@ Coverage Diff @@
## master #98 +/- ##
===========================================
- Coverage 52.40% 35.77% -16.63%
===========================================
Files 8 9 +1
Lines 250 341 +91
===========================================
- Hits 131 122 -9
- Misses 97 197 +100
Partials 22 22
Continue to review full report at Codecov.
|
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 clearly shows why tests pay off!
Thanks for stepping up and fixing this!
Before I can merge, I need to ask you though to signoff your commit (see here).
scope string | ||
wantCluster bool | ||
wantNamespace bool | ||
wantErr bool |
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.
No need for change, just a thought: If you introduce a struct like this
type result struct {
cluster, namespace, err bool
}
you can do all three comparisons at once like so:
if diff := cmp.Diff(test.want, got); diff != "" {
t.Errorf("getResourceScope(..) returned unexpected result (-want,+got)\n%s", diff)
}
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.
Neat! I'll keep that in mind for next time
Signed-off-by: Arthur Busser <[email protected]>
Signed-off-by: Arthur Busser <[email protected]>
@corneliusweig Commits are signed off 👍 |
Fix #93