~netlandish/gobwebs

3f4e458c093cb193827226aa307647e2f22feadc — Peter Sanchez 1 year, 9 months ago 89f8c57
Nulling out transaction upon commit and rollback
1 files changed, 6 insertions(+), 2 deletions(-)

M database/db.go
M database/db.go => database/db.go +6 -2
@@ 41,7 41,9 @@ func (d *DB) CommitTx() error {
		return errors.New("You have no active db transaction")
	}
	if d.commit {
		return d.tx.Commit()
		err := d.tx.Commit()
		d.tx = nil
		return err
	}
	return nil
}


@@ 51,7 53,9 @@ func (d *DB) RollbackTx() error {
	if d.tx == nil {
		return errors.New("You have no active db transaction")
	}
	return d.tx.Rollback()
	err := d.tx.Rollback()
	d.tx = nil
	return err
}

// WillCommit will return the value of commit