Merge 1ab3bc5316bb90ef9286092e57edf1c160bdde4a into f6260a00852946a10a57e8bb9f505f19bc9389b7

This commit is contained in:
Andrey Nehaychik 2018-09-27 09:20:37 +00:00 committed by GitHub
commit b13d48ef16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
main.go
View File

@ -530,11 +530,21 @@ func (s *DB) NewRecord(value interface{}) bool {
// RecordNotFound check if returning ErrRecordNotFound error // RecordNotFound check if returning ErrRecordNotFound error
func (s *DB) RecordNotFound() bool { func (s *DB) RecordNotFound() bool {
if s.search.raw {
rows, err := s.Rows()
defer rows.Close()
if err != nil {
return false
}
return !rows.Next()
}
for _, err := range s.GetErrors() { for _, err := range s.GetErrors() {
if err == ErrRecordNotFound { if err == ErrRecordNotFound {
return true return true
} }
} }
return false return false
} }