func NewFromCF(cfgFile string) (*Conn, map[string]string, error) { raw, unk, err := mysql.NewFromCF(cfgFile) if err != nil { return nil, nil, err } return &Conn{raw, 7, false}, unk, nil }
func initMySQL() { var err error Db, _, err = mysql.NewFromCF("./connection.txt") if err != nil { log.Println(err.Error()) // Just for example purpose. You should use proper error handling instead of panic return } Db.SetMaxPktSize(1024 * 1024 * 1024) err = Db.Connect() if err != nil { log.Println(err.Error()) // Just for example purpose. You should use proper error handling instead of panic return } }