mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-08 20:30:43 +08:00
17 lines
227 B
Go
17 lines
227 B
Go
package db
|
|
|
|
import (
|
|
"database/sql"
|
|
)
|
|
|
|
// CloseConnection 关闭数据库连接
|
|
func CloseConnection(conn *sql.DB) (err error) {
|
|
err = conn.Close()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
_, err = GetMySQLConnInfo(conn)
|
|
return
|
|
}
|