Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change wording of error message for unset query return value #105

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions sqlmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func (c *sqlmock) exec(query string, args []namedValue) (*ExpectedExec, error) {
}

if expected.result == nil {
return nil, fmt.Errorf("ExecQuery '%s' with args %+v, must return a database/sql/driver.Result, but it was not set for expectation %T as %+v", query, args, expected, expected)
return nil, fmt.Errorf("No required return value of type database/sql/driver.Result was set for expectation %T as %+v", expected, expected)
}

return expected, nil
Expand Down Expand Up @@ -446,7 +446,7 @@ func (c *sqlmock) query(query string, args []namedValue) (*ExpectedQuery, error)
}

if expected.rows == nil {
return nil, fmt.Errorf("Query '%s' with args %+v, must return a database/sql/driver.Rows, but it was not set for expectation %T as %+v", query, args, expected, expected)
return nil, fmt.Errorf("No required return value of type database/sql/driver.Rows was set for expectation %T as %+v", expected, expected)
}
return expected, nil
}
Expand Down