-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
LINDEX implementation added #1395
base: master
Are you sure you want to change the base?
Conversation
@apoorvyadav1111 @lucifercr07 Please review the PR . Issue : #1339 |
Hi @Arijit6258, apologies for the delayed review. The team is now returning from vacations and will review this soon. In the meantime could you please resolve the merge conflicts that are happening? |
Hi @JyotinderSingh , sure I will check. |
@JyotinderSingh I have merged the latest master. There is a failure in integration test,which is due to some commit in master. You can check master branch has also test-failed commits. |
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, minor comments.
|
||
obj := store.Get(key) | ||
|
||
if obj == 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.
If a key doesn't exist we should return nil
similar to redis.
> LINDEX test 1
(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.
@lucifercr07 does "(nil)" works ?? (nil) with string quotation.
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.
Do we need to make the behavior exactly like Redis? I feel the user might not be able to understand why (nil) is being returned in this case. Showing users a proper error message seems to be a better solution to me.
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.
@lucifercr07 @JyotinderSingh waiting for your replies. Accordingly I will change and update the PR.
index, err := strconv.ParseInt(args[1], 10, 64) | ||
|
||
if err != nil { | ||
return makeEvalError(errors.New("-ERR value is not an integer or out of range")) |
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.
Shall we reuse this var here? IntOrOutOfRangeErr
We can create similar in migrated_errors.go
and reuse it.
No description provided.