Skip to content

Commit

Permalink
readable db sample
Browse files Browse the repository at this point in the history
  • Loading branch information
lainio committed Oct 8, 2024
1 parent ef13eed commit 5d98a51
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions samples/main-db-sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ func (db *Database) MoneyTransfer(from, to *Account, amount int) (err error) {
})

try.To(from.ReserveBalance(tx, amount))

defer err2.Handle(
&err,
func(err error) error { // optional, following sample's wording
err = fmt.Errorf("cannot %w", err)
return err
},
)

try.To(from.Withdraw(tx, amount))
try.To(to.Deposit(tx, amount))
try.To(tx.Commit())
Expand Down

0 comments on commit 5d98a51

Please sign in to comment.