From e749ba3531cf430b66e1d3f310f53ea2972e3aa3 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 6 Nov 2019 16:14:47 +1100 Subject: Make returns explicit --- retry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'retry.go') diff --git a/retry.go b/retry.go index 7800ae9..92efb9e 100644 --- a/retry.go +++ b/retry.go @@ -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 } -- cgit v1.2.3