From 5cc9f537546a3c213d03c5f375fb9400f31118b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B8=A0=E7=A3=8A?= Date: Sat, 6 May 2023 10:51:24 +0800 Subject: [PATCH 1/2] optimized the execution flow of the TestRowsColumnTypes unit test --- driver_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/driver_test.go b/driver_test.go index 1741a13ef..e543cc3f0 100644 --- a/driver_test.go +++ b/driver_test.go @@ -2945,7 +2945,10 @@ func TestRowsColumnTypes(t *testing.T) { continue } } - + //Avoid:values is nil + if t.Failed() { + return + } values := make([]interface{}, len(tt)) for i := range values { values[i] = reflect.New(types[i]).Interface() From 66a50e4639601125085744cd34bcd5945385710e Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sat, 6 May 2023 17:39:36 +0900 Subject: [PATCH 2/2] Update driver_test.go --- driver_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver_test.go b/driver_test.go index e543cc3f0..d24488a82 100644 --- a/driver_test.go +++ b/driver_test.go @@ -2945,7 +2945,7 @@ func TestRowsColumnTypes(t *testing.T) { continue } } - //Avoid:values is nil + // Avoid panic caused by nil scantype. if t.Failed() { return }