sqlx: fixed transacation help function logic error

pull/351/head
Michael Li 2 years ago
parent 62f348a714
commit 4698807574
No known key found for this signature in database

@ -42,7 +42,7 @@ func (s *sqlxServant) withTx(ctx context.Context, opts *sql.TxOptions, handle fu
return err
}
defer tx.Rollback()
if err = handle(tx); err == nil {
if err = handle(tx); err != nil {
return err
}
return tx.Commit()

Loading…
Cancel
Save