Open NeoZephyr opened 2 years ago
if tx, err = dao.BeginTran(c); err != nil { err = errors.Wrapf(err, "dao.BeginTran(%d)", mid) return } defer func() { if err != nil { if err1 := tx.Rollback(); err1 != nil { err = errors.Wrapf(err, "tx.Rollback(%d)", mid) } return } if err = tx.Commit(); err != nil { err = errors.Wrapf(err, "tx.Commit(%d)", mid) } }()