-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Client: fix check for WithPrefix op #14182
Conversation
client/v3/op.go
Outdated
@@ -391,6 +391,7 @@ func WithPrefix() OpOption { | |||
return func(op *Op) { | |||
if len(op.key) == 0 { | |||
op.key, op.end = []byte{0}, []byte{0} | |||
op.isOptsWithPrefix = true |
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.
minor comment: Both line 394 and 397 set isOptsWithPrefix
as true
, so I suggest to move op.isOptsWithPrefix = true
to the beginning of the function.
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.
@ahrtr Good catch, I missed it. Thanks!
Codecov Report
@@ Coverage Diff @@
## main #14182 +/- ##
==========================================
- Coverage 75.47% 75.23% -0.24%
==========================================
Files 455 455
Lines 36846 36846
==========================================
- Hits 27808 27722 -86
- Misses 7314 7381 +67
- Partials 1724 1743 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Make sure that WithPrefix correctly set the flag, and add test. Also, add test for WithFromKey. fixes etcd-io#14056 Signed-off-by: Sahdev Zala <[email protected]>
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
@ahrtr @serathius thanks for the quick review! Build is green so merging. |
…-upstream-release-3.5 Automated cherry pick of #14182
Make sure that WithPrefix correctly set the flag, and add test.
Also, add test for WithFromKey.
fixes #14056