Update 'tags/parser.go'
Solve runtime problem:"panic: reflect.Value.Interface: cannot return value obtained from unexported field or method"
This commit is contained in:
parent
17f28a1314
commit
756fdfdd79
|
@ -253,7 +253,7 @@ func (parser *Parser) Parse(v reflect.Value) (*schemas.Table, error) {
|
|||
addIndex(indexName, table, col, indexType)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if fieldValue.CanSet(){
|
||||
var sqlType schemas.SQLType
|
||||
if fieldValue.CanAddr() {
|
||||
if _, ok := fieldValue.Addr().Interface().(convert.Conversion); ok {
|
||||
|
@ -272,6 +272,8 @@ func (parser *Parser) Parse(v reflect.Value) (*schemas.Table, error) {
|
|||
if fieldType.Kind() == reflect.Int64 && (strings.ToUpper(col.FieldName) == "ID" || strings.HasSuffix(strings.ToUpper(col.FieldName), ".ID")) {
|
||||
idFieldColName = col.Name
|
||||
}
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
if col.IsAutoIncrement {
|
||||
col.Nullable = false
|
||||
|
|
Loading…
Reference in New Issue