Scan now skips ignored fields when setting values
This commit is contained in:
parent
81c17a7e25
commit
762298bba3
3
scope.go
3
scope.go
@ -493,6 +493,9 @@ func (scope *Scope) scan(rows *sql.Rows, columns []string, fields []*Field) {
|
||||
}
|
||||
|
||||
for fieldIndex, field := range selectFields {
|
||||
if field.IsIgnored {
|
||||
continue
|
||||
}
|
||||
if field.DBName == column {
|
||||
if field.Field.Kind() == reflect.Ptr {
|
||||
values[index] = field.Field.Addr().Interface()
|
||||
|
Loading…
x
Reference in New Issue
Block a user