1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-07 12:42:55 +03:00

hscan adds support for i386 platform (#1652)

* hscan adds support for i386 platform

Signed-off-by: monkey <monkey92t@gmail.com>

* update go.sum

Signed-off-by: monkey <monkey92t@gmail.com>

* detect overflow of scan

Signed-off-by: monkey <golang@88.com>

* restore the return value type of decoderFunc to error

Signed-off-by: monkey <golang@88.com>

* fix clean

Signed-off-by: monkey <golang@88.com>

* fix clean

Signed-off-by: monkey <golang@88.com>

Co-authored-by: Monkey <monkey@MonkeydeiMac.local>
This commit is contained in:
monkey92t
2021-02-09 20:44:24 +08:00
committed by GitHub
parent fd6fac1a1a
commit 27df2313cd
4 changed files with 156 additions and 41 deletions

View File

@@ -1,6 +1,7 @@
package hscan
import (
"fmt"
"reflect"
"strings"
"sync"
@@ -83,5 +84,10 @@ func (s StructValue) Scan(key string, value string) error {
if !ok {
return nil
}
return field.fn(s.value.Field(field.index), value)
if err := field.fn(s.value.Field(field.index), value); err != nil {
t := s.value.Type()
return fmt.Errorf("cannot scan redis.result %s into struct field %s.%s of type %s, error-%s",
value, t.Name(), t.Field(field.index).Name, t.Field(field.index).Type, err.Error())
}
return nil
}