You've already forked go-sqlxmock
mirror of
https://github.com/zhashkevych/go-sqlxmock.git
synced 2025-06-24 21:56:48 +02:00
docs for ExpectPrepare
This commit is contained in:
@ -315,6 +315,13 @@ rs := sqlmock.NewRows([]string{"column1", "column2"}).
|
||||
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
|
||||
|
||||
go test
|
||||
|
Reference in New Issue
Block a user