From a582f801e1159a1a495fc838e06e0a2494e11ea4 Mon Sep 17 00:00:00 2001 From: Yongzheng Lai Date: Tue, 16 Feb 2016 14:09:01 +0800 Subject: [PATCH] Update main.go Ex: ```go type User struct { ID int64 Name string `sql:"not null;unique"` Hobby []string `sql:"-"` HobbyStr string `sql:"type:text"` } u := &User{Name:"ElvizLai"} fmt.Println(db.Last(u, "5x").RecordNotFound())//should be true but it return false ``` It has error: "Unknown column '5x' in 'where clause'", This maybe also belongs to "RecordNotFound" --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index f2eeb5d6..28b09540 100644 --- a/main.go +++ b/main.go @@ -369,7 +369,7 @@ func (s *DB) NewRecord(value interface{}) bool { } func (s *DB) RecordNotFound() bool { - return s.Error == RecordNotFound + return s.Error == RecordNotFound || s.Error != nil } // Migrations