From 33267428f77eb99023f936a2b9b330416053d67a Mon Sep 17 00:00:00 2001 From: Bui Quoc Trong Date: Tue, 2 Mar 2021 17:56:02 +0700 Subject: [PATCH] Implement driver.Validator interface (#1174) --- connection.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/connection.go b/connection.go index 90aec6439..835f89729 100644 --- a/connection.go +++ b/connection.go @@ -642,3 +642,9 @@ func (mc *mysqlConn) ResetSession(ctx context.Context) error { mc.reset = true return nil } + +// IsValid implements driver.Validator interface +// (From Go 1.15) +func (mc *mysqlConn) IsValid() bool { + return !mc.closed.IsSet() +}