Ejemplo n.º 1
0
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
}
Ejemplo n.º 2
0
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
	}

}