1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2025-06-12 21:47:29 +02:00

allow to set errors for rows scan

* 9a36c2e more examples and tests for rows
* 908877e cannot mock rows.Columns error so far
This commit is contained in:
gedi
2015-07-22 16:17:35 +03:00
parent a071483cba
commit dc0efdab8f
5 changed files with 261 additions and 11 deletions

View File

@ -201,6 +201,7 @@ func (c *Sqlmock) Query(query string, args []driver.Value) (rw driver.Rows, err
return nil, t.err // mocked to return error
}
// remove when rows_test.go:186 is available, won't cause a BC
if t.rows == nil {
return nil, fmt.Errorf("query '%s' with args %+v, must return a database/sql/driver.rows, but it was not set for expectation %T as %+v", query, args, t, t)
}