mirror of
https://github.com/redis/go-redis.git
synced 2025-04-17 20:17:02 +03:00
Prevent index out of bunds error
I'm reusing this driver for disque client... and get index out of bounds error because there really are just 2 items in array not 3.
This commit is contained in:
parent
3fbf7df014
commit
40f80e8913
@ -44,9 +44,10 @@ func (it *ScanIterator) Next(ctx context.Context) bool {
|
||||
}
|
||||
|
||||
// Fetch next page.
|
||||
if it.cmd.args[0] == "scan" {
|
||||
switch it.cmd.args[0] {
|
||||
case "scan", "qscan":
|
||||
it.cmd.args[1] = it.cmd.cursor
|
||||
} else {
|
||||
default:
|
||||
it.cmd.args[2] = it.cmd.cursor
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user