I'll try anything now o.o

This commit is contained in:
Azareal 2018-08-29 13:31:52 +10:00
parent 6839dd5ffb
commit 28ba465c8a
1 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,6 @@ import (
"database/sql" "database/sql"
"errors" "errors"
"fmt" "fmt"
"log"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
@ -66,11 +65,13 @@ func (adapter *MysqlAdapter) BuildConn(config map[string]string) (*sql.DB, error
} }
db, err := sql.Open("mysql", config["username"]+dbpassword+"@unix("+dbsocket+")/"+config["name"]+"?collation="+dbCollation+"&parseTime=true") db, err := sql.Open("mysql", config["username"]+dbpassword+"@unix("+dbsocket+")/"+config["name"]+"?collation="+dbCollation+"&parseTime=true")
log.Print("err: ", err)
if err == nil { if err == nil {
// Make sure that the connection is alive // Make sure that the connection is alive
return db, db.Ping() return db, db.Ping()
} }
// Am I supposed to do this? o.O
db, err = nil, nil
} }
// Open the database connection // Open the database connection