diff options
author | Matt Joiner <anacrolix@gmail.com> | 2019-11-06 16:14:47 +1100 |
---|---|---|
committer | Matt Joiner <anacrolix@gmail.com> | 2019-11-06 16:14:47 +1100 |
commit | e749ba3531cf430b66e1d3f310f53ea2972e3aa3 (patch) | |
tree | 328dbb9b2078908a8967483a0829ac4acb54cc9a /retry.go | |
parent | Add WouldBlock (diff) | |
download | stm-e749ba3531cf430b66e1d3f310f53ea2972e3aa3.tar.gz stm-e749ba3531cf430b66e1d3f310f53ea2972e3aa3.tar.xz |
Make returns explicit
Diffstat (limited to 'retry.go')
-rw-r--r-- | retry.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -5,7 +5,7 @@ package stm const Retry = "retry" // catchRetry returns true if fn calls tx.Retry. -func catchRetry(fn func(*Tx), tx *Tx) (retry bool) { +func catchRetry(fn Operation, tx *Tx) (result interface{}, retry bool) { defer func() { if r := recover(); r == Retry { retry = true @@ -13,6 +13,6 @@ func catchRetry(fn func(*Tx), tx *Tx) (retry bool) { panic(r) } }() - fn(tx) + result = fn(tx) return } |