Fix duplicated scan for Scaner
package resource
import (
+ "database/sql"
"errors"
"reflect"
@@ -89,11 +90,13 @@ func (processor *processor) decode() (errors []error) {
if res := metaValue.Meta.GetResource(); res != nil && !reflect.ValueOf(res).IsNil() {
field := reflect.Indirect(reflect.ValueOf(processor.Result)).FieldByName(meta.GetFieldName())
if utils.ModelType(field.Addr().Interface()) == utils.ModelType(res.NewStruct()) {
+ if _, ok := field.Addr().Interface().(sql.Scanner); !ok {
decodeMetaValuesToField(res, field, metaValue, processor.Context)
}
}
}
}
+ }
return
}
