From f42b0f65fc3cf53d75f1999f5b9fb35b720bda52 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 12 May 2018 19:59:12 -0500 Subject: [PATCH] Commit and rollbase need not check for failure state --- tx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tx.go b/tx.go index 1fe9d72a..c7731dde 100644 --- a/tx.go +++ b/tx.go @@ -117,7 +117,7 @@ func (tx *Tx) Commit() error { // CommitEx commits the transaction with a context. func (tx *Tx) CommitEx(ctx context.Context) error { - if !(tx.Status() == TxStatusInProgress || tx.Status() == TxStatusInFailure) { + if tx.status != TxStatusInProgress { return ErrTxClosed } @@ -152,7 +152,7 @@ func (tx *Tx) Rollback() error { // RollbackEx is the context version of Rollback func (tx *Tx) RollbackEx(ctx context.Context) error { - if !(tx.Status() == TxStatusInProgress || tx.Status() == TxStatusInFailure) { + if tx.status != TxStatusInProgress { return ErrTxClosed }