You've already forked go-sqlxmock
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:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user