1
0
mirror of https://github.com/zhashkevych/go-sqlxmock.git synced 2025-06-12 21:47:29 +02:00
This commit is contained in:
gedi
2016-02-26 14:38:04 +02:00
parent 55a0289da5
commit b465b1f024
2 changed files with 33 additions and 1 deletions

View File

@ -340,7 +340,6 @@ func (c *sqlmock) Query(query string, args []driver.Value) (rw driver.Rows, err
}
defer expected.Unlock()
expected.triggered = true
if !expected.queryMatches(query) {
return nil, fmt.Errorf("query '%s', does not match regex [%s]", query, expected.sqlRegex.String())
@ -358,6 +357,7 @@ func (c *sqlmock) Query(query string, args []driver.Value) (rw driver.Rows, err
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, expected, expected)
}
expected.triggered = true
return expected.rows, err
}