Skip to content

Commit

Permalink
Avoid panic in TestRowsColumnTypes (#1426)
Browse files Browse the repository at this point in the history
* optimized the execution flow of the TestRowsColumnTypes unit test

* Update driver_test.go

---------

Co-authored-by: 渠磊 <[email protected]>
Co-authored-by: Inada Naoki <[email protected]>
  • Loading branch information
3 people committed May 6, 2023
1 parent 191a7c4 commit 0b40aee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,10 @@ func TestRowsColumnTypes(t *testing.T) {
continue
}
}

// Avoid panic caused by nil scantype.
if t.Failed() {
return
}
values := make([]interface{}, len(tt))
for i := range values {
values[i] = reflect.New(types[i]).Interface()
Expand Down

0 comments on commit 0b40aee

Please sign in to comment.