1
0
mirror of https://github.com/DATA-DOG/go-sqlmock.git synced 2025-07-03 00:36:52 +02:00

Modify: existing panic in AddRow to give a hint to the issue

This commit is contained in:
Mae Kennedy
2023-10-19 17:24:06 +00:00
parent b2f0b45ee8
commit e4270300ef
2 changed files with 26 additions and 1 deletions

View File

@ -166,7 +166,7 @@ func (r *Rows) RowError(row int, err error) *Rows {
// of columns
func (r *Rows) AddRow(values ...driver.Value) *Rows {
if len(values) != len(r.cols) {
panic("Expected number of values to match number of columns")
panic(fmt.Sprintf("Expected number of values to match number of columns: expected %d, actual %d", len(values), len(r.cols)))
}
row := make([]driver.Value, len(r.cols))