1
0
mirror of https://github.com/DATA-DOG/go-sqlmock.git synced 2025-05-13 21:56:39 +02:00

Merge pull request #249 from maguro/magurl/fix-exepectexec-stringer

Fix ExpectedExec Stringer implementation
This commit is contained in:
Gediminas Morkevicius 2021-01-16 11:40:58 +02:00 committed by GitHub
commit 07eed2a098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -230,12 +230,13 @@ func (e *ExpectedExec) String() string {
}
if e.result != nil {
res, _ := e.result.(*result)
msg += "\n - should return Result having:"
msg += fmt.Sprintf("\n LastInsertId: %d", res.insertID)
msg += fmt.Sprintf("\n RowsAffected: %d", res.rowsAffected)
if res.err != nil {
msg += fmt.Sprintf("\n Error: %s", res.err)
if res, ok := e.result.(*result); ok {
msg += "\n - should return Result having:"
msg += fmt.Sprintf("\n LastInsertId: %d", res.insertID)
msg += fmt.Sprintf("\n RowsAffected: %d", res.rowsAffected)
if res.err != nil {
msg += fmt.Sprintf("\n Error: %s", res.err)
}
}
}