-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add LCS #767
Add LCS #767
Conversation
return cmd | ||
} | ||
|
||
func (cmd *LCSCmd) from(res rueidis.RedisResult) { |
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 parsing function seems incorrect. Is it compatible with https://github.com/redis/go-redis/blob/196fc9b21ac460f0d5251d349e4249e2ffedb9ff/command.go#L4510?
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.
My bad. I misunderstood what was required. I’ve added a new commit with the necessary changes.
rueidiscompat/command.go
Outdated
switch cmd.readType { | ||
case 1: | ||
// match string | ||
if lcs.MatchString, err = res.ToString(); err == 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 lcs.MatchString, err = res.ToString(); err == nil { | |
if lcs.MatchString, err = res.ToString(); err != nil { |
Shouldn't this be err != nil
?
rueidiscompat/command.go
Outdated
} | ||
case 2: | ||
// match len | ||
if lcs.Len, err = res.AsInt64(); err == 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 lcs.Len, err = res.AsInt64(); err == nil { | |
if lcs.Len, err = res.AsInt64(); err != nil { |
Shouldn't this be err != nil
?
rueidiscompat/command.go
Outdated
} | ||
case 3: | ||
// read LCSMatch | ||
if msgMap, err := res.AsMap(); err == 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.
What if err != 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.
Addressed
Thank you @arbha1erao |
#749