1
0
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:
Luigi Kapaj 2014-09-24 16:13:35 -04:00
parent cd47226ce2
commit 8db2b3b2d2

View File

@ -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