Don't access scanner's fields if already defined data type

This commit is contained in:
Jinzhu 2018-02-18 09:00:03 +08:00
parent 55945afb34
commit 58e34726df
1 changed files with 8 additions and 6 deletions

View File

@ -94,6 +94,7 @@ var ParseFieldStructForDialect = func(field *StructField, dialect Dialect) (fiel
}
// Get scanner's real value
if dataType == "" {
var getScannerValue func(reflect.Value)
getScannerValue = func(value reflect.Value) {
fieldValue = value
@ -102,6 +103,7 @@ var ParseFieldStructForDialect = func(field *StructField, dialect Dialect) (fiel
}
}
getScannerValue(fieldValue)
}
// Default Size
if num, ok := field.TagSettings["SIZE"]; ok {