mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-04-23 11:58:47 +02:00
docs for ExpectPrepare
This commit is contained in:
parent
cd47226ce2
commit
8db2b3b2d2
@ -315,6 +315,13 @@ rs := sqlmock.NewRows([]string{"column1", "column2"}).
|
|||||||
AddRow("three", 3)
|
AddRow("three", 3)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Prepare** will ignore other expectations if ExpectPrepare not set. When set, can expect normal result or simulate an error:
|
||||||
|
|
||||||
|
``` go
|
||||||
|
rs := sqlmock.ExpectPrepare().
|
||||||
|
WillReturnError(fmt.Errorf("Query prepare failed"))
|
||||||
|
```
|
||||||
|
|
||||||
## Run tests
|
## Run tests
|
||||||
|
|
||||||
go test
|
go test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user