mirror of https://github.com/go-gorm/gorm.git
retrieving gorm object support pointer (#4006)
This commit is contained in:
parent
81aa949105
commit
cc61202fe2
2
scan.go
2
scan.go
|
@ -191,7 +191,7 @@ func Scan(rows *sql.Rows, db *DB, initialized bool) {
|
|||
db.Statement.ReflectValue.Set(reflect.Append(db.Statement.ReflectValue, elem.Elem()))
|
||||
}
|
||||
}
|
||||
case reflect.Struct:
|
||||
case reflect.Struct, reflect.Ptr:
|
||||
if db.Statement.ReflectValue.Type() != Schema.ModelType {
|
||||
Schema, _ = schema.Parse(db.Statement.Dest, db.cacheStore, db.NamingStrategy)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue