Skip to content

Commit

Permalink
Merge c05a6a2 into 99ac97e
Browse files Browse the repository at this point in the history
  • Loading branch information
xaicron committed Nov 9, 2018
2 parents 99ac97e + c05a6a2 commit c105b3f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tm/transaction_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ func Run(db SQL, f TxnFunc) error {
tx.Rollback()
return err
}
tx.Commit()
return nil
return tx.Commit()
}

// RunWithContext begins transaction with context.Conntext around TxnFunc.
Expand All @@ -97,8 +96,7 @@ func RunWithContext(ctx context.Context, opts *sql.TxOptions, db SQL, f TxnFunc)
tx.Rollback()
return err
}
tx.Commit()
return nil
return tx.Commit()
}

// Runx begins transaction around TxnxFunc.
Expand All @@ -113,8 +111,7 @@ func Runx(db SQLx, f TxnxFunc) error {
tx.Rollback()
return err
}
tx.Commit()
return nil
return tx.Commit()
}

// RunxWithContext begins transaction with context.Conntext around TxnxFunc.
Expand All @@ -129,6 +126,5 @@ func RunxWithContext(ctx context.Context, opts *sql.TxOptions, db SQLx, f TxnxFu
tx.Rollback()
return err
}
tx.Commit()
return nil
return tx.Commit()
}

0 comments on commit c105b3f

Please sign in to comment.