1
0
mirror of https://github.com/DATA-DOG/go-sqlmock.git synced 2025-06-23 00:17:47 +02:00

allow unordered expectation matching, support for goroutines

* 1778939 take care of locks for goroutine based matching
This commit is contained in:
gedi
2015-08-26 14:28:01 +03:00
parent 5a740a6373
commit 566ca54083
4 changed files with 276 additions and 103 deletions

View File

@ -44,7 +44,7 @@ func New() (db *sql.DB, mock *Sqlmock, err error) {
dsn := fmt.Sprintf("sqlmock_db_%d", pool.counter)
pool.counter++
mock = &Sqlmock{dsn: dsn, drv: pool}
mock = &Sqlmock{dsn: dsn, drv: pool, MatchExpectationsInOrder: true}
pool.conns[dsn] = mock
pool.Unlock()