From adc813adeb63f50613460f064d1ab8c4855633cb Mon Sep 17 00:00:00 2001 From: Trong Bui Date: Tue, 1 Dec 2020 13:55:09 +0700 Subject: [PATCH] Implement driver.Validator interface --- 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() +}