You've already forked go-sqlmock
mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-07-11 01:00:17 +02:00
Update expectations_go18.go to accept WillReturnRows(nil)
The addition of the resultset logic caused a nil pointer dereference panic whenever nil is used as an input.
This commit is contained in:
@ -16,7 +16,7 @@ func (e *ExpectedQuery) WillReturnRows(rows ...*Rows) *ExpectedQuery {
|
||||
sets := make([]*Rows, len(rows))
|
||||
for i, r := range rows {
|
||||
sets[i] = r
|
||||
if r.def != nil {
|
||||
if r != nil && r.def != nil {
|
||||
defs++
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user