Skip to content

Commit f49f106

Browse files
committed
docs: fix formatting
1 parent e5a7fe3 commit f49f106

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ writer := outbox.NewWriter(dbCtx)
4141

4242
// --- Option 1: Library-managed transactions (recommended) ---
4343
//
44-
// The library handles begin/commit/rollback. If the callback returns an error, the transaction is rolled back
44+
// The library handles begin/commit/rollback. If the callback returns an error,
45+
// the transaction is rolled back
4546
//
4647
// Use Write function for conditional or multiple message publishing
47-
err = writer.Write(ctx, func(ctx context.Context, tx outbox.TxQueryer, msgWriter outbox.MessageWriter) error {
48+
err = writer.Write(ctx,
49+
func(ctx context.Context, tx outbox.TxQueryer, msgWriter outbox.MessageWriter) error {
50+
4851
result, err := tx.ExecContext(ctx,
49-
"UPDATE orders SET status = 'confirmed' WHERE id = $1 AND status = 'pending'", orderID)
52+
"UPDATE orders SET status = 'confirmed' WHERE id = $1 AND status = 'pending'", id)
5053
if err != nil {
5154
return err
5255
}
@@ -146,6 +149,7 @@ reader := outbox.NewReader(
146149
)
147150
reader.Start()
148151
defer reader.Stop(context.Background()) // Stop during application shutdown
152+
```
149153

150154
<details>
151155
<summary><strong>📊 Error Monitoring</strong></summary>

0 commit comments

Comments
 (0)