Skip to content

Commit

Permalink
Merge pull request #249 from maguro/magurl/fix-exepectexec-stringer
Browse files Browse the repository at this point in the history
Fix ExpectedExec Stringer implementation
  • Loading branch information
l3pp4rd authored Jan 16, 2021
2 parents c35a79d + ad48e46 commit 07eed2a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down

0 comments on commit 07eed2a

Please sign in to comment.