Commit 1c0f9310 authored by Hamdi Allam's avatar Hamdi Allam

can directly compare dbValue with nil

parent 79476c17
...@@ -18,7 +18,7 @@ func init() { ...@@ -18,7 +18,7 @@ func init() {
} }
func (BytesSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) error { func (BytesSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) error {
if dbValue == nil || (field.FieldType.Kind() == reflect.Pointer && reflect.ValueOf(dbValue).IsNil()) { if dbValue == nil {
return nil return nil
} }
......
...@@ -18,7 +18,7 @@ func init() { ...@@ -18,7 +18,7 @@ func init() {
} }
func (RLPSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) error { func (RLPSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) error {
if dbValue == nil || (field.FieldType.Kind() == reflect.Pointer && reflect.ValueOf(dbValue).IsNil()) { if dbValue == nil {
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment