diff --git a/db.go b/db.go index 11aa1f5..b46f1d5 100644 --- a/db.go +++ b/db.go @@ -114,6 +114,7 @@ func MustOpen(driverName, dsn string) (*DB, error) { return nil, err } if err := db.sqlDB.Ping(); err != nil { + db.Close() return nil, err } return db, nil