From a4ba25028d95f885dcd5c399577f04d2dc413b29 Mon Sep 17 00:00:00 2001 From: Ian Tan Date: Mon, 20 Nov 2017 16:02:40 +0800 Subject: [PATCH] Add Value() method to gorm_test.Num to prevent scan error --- migration_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migration_test.go b/migration_test.go index 3f3a5c8f..6c10f62e 100644 --- a/migration_test.go +++ b/migration_test.go @@ -139,6 +139,11 @@ func (role Role) IsAdmin() bool { type Num int64 +func (i *Num) Value() (driver.Value, error) { + // guaranteed ok + return int64(*i), nil +} + func (i *Num) Scan(src interface{}) error { switch s := src.(type) { case []byte: