You've already forked go-sqlxmock
mirror of
https://github.com/zhashkevych/go-sqlxmock.git
synced 2025-06-12 21:47:29 +02:00
closes #24
This commit is contained in:
@ -12,6 +12,7 @@ are also supported.
|
||||
package sqlmock
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
"reflect"
|
||||
@ -79,6 +80,14 @@ type sqlmock struct {
|
||||
expected []expectation
|
||||
}
|
||||
|
||||
func (s *sqlmock) open() (*sql.DB, Sqlmock, error) {
|
||||
db, err := sql.Open("sqlmock", s.dsn)
|
||||
if err != nil {
|
||||
return db, s, err
|
||||
}
|
||||
return db, s, db.Ping()
|
||||
}
|
||||
|
||||
func (c *sqlmock) ExpectClose() *ExpectedClose {
|
||||
e := &ExpectedClose{}
|
||||
c.expected = append(c.expected, e)
|
||||
|
Reference in New Issue
Block a user