var db *sql.DB
func connectDB() {
db, _ = sql.Open("mysql", "root@/dbname")
}
var db *sql.DB
func connectDB() {
var err error
db, err = sql.Open("mysql", "root@/dbname")
}
var db *sql.DB
func connectDB() error {
var err error
if db, err = sql.Open("mysql", "root@/dbname"); err != nil {
return err
}
var db *sql.DB
func connectDB() (err error) {
db, err = sql.Open("mysql", "root@/dbname")
return
}