From 9f1f883c452201679a2d2af2cc29de0f09a43f28 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Thu, 19 May 2022 10:39:53 +0800 Subject: [PATCH] database/sql: save Close error into lasterr --- src/database/sql/sql.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go index 2146d96dc59..e6ef3fc6156 100644 --- a/src/database/sql/sql.go +++ b/src/database/sql/sql.go @@ -2987,10 +2987,7 @@ func (rs *Rows) Next() bool { doClose, ok = rs.nextLocked() }) if doClose { - err := rs.Close() - if err != nil { - rs.Close() - } + rs.Close() } return ok }