Skip to content

Commit 5d98a51

Browse files
committed
readable db sample
1 parent ef13eed commit 5d98a51

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

samples/main-db-sample.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,6 @@ func (db *Database) MoneyTransfer(from, to *Account, amount int) (err error) {
2929
})
3030

3131
try.To(from.ReserveBalance(tx, amount))
32-
33-
defer err2.Handle(
34-
&err,
35-
func(err error) error { // optional, following sample's wording
36-
err = fmt.Errorf("cannot %w", err)
37-
return err
38-
},
39-
)
40-
4132
try.To(from.Withdraw(tx, amount))
4233
try.To(to.Deposit(tx, amount))
4334
try.To(tx.Commit())

0 commit comments

Comments
 (0)