1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

Fix slice next elem func

This commit is contained in:
Vladimir Mihailenco
2017-11-01 15:33:53 +02:00
parent 35248155a5
commit 48b70050d4
2 changed files with 28 additions and 12 deletions

View File

@ -120,8 +120,9 @@ func ScanSlice(data []string, slice interface{}) error {
return fmt.Errorf("redis: ScanSlice(non-slice %T)", slice)
}
next := internal.MakeSliceNextElemFunc(v)
for i, s := range data {
elem := internal.SliceNextElem(v)
elem := next()
if err := Scan(internal.StringToBytes(s), elem.Addr().Interface()); err != nil {
return fmt.Errorf("redis: ScanSlice(index=%d value=%q) failed: %s", i, s, err)
}