From cc61202fe2df0630fdfbc6cc31b455a5d76a2494 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 27 Jan 2021 11:50:15 +0800 Subject: [PATCH] retrieving gorm object support pointer (#4006) --- scan.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scan.go b/scan.go index 0416489d..acd637a4 100644 --- a/scan.go +++ b/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) }