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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user