From abb2bbf3b5148dbb3f5efde8fc2b71ef7cf56015 Mon Sep 17 00:00:00 2001 From: guzeng Date: Mon, 22 Mar 2021 16:29:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=ADsqlserver=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sqlserver.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sqlserver.go b/sqlserver.go index c8cc099..6c4a46d 100644 --- a/sqlserver.go +++ b/sqlserver.go @@ -58,5 +58,8 @@ func MSConnect(DBHOST, DBUSER, DBPWD, DBNAME, DBPORT string, conns ...int) error } func CloseMSConn() error { - return MSDB_CONN.Close() + if MSDB_CONN != nil { + return MSDB_CONN.Close() + } + return nil }