From d04075d6f23e92c33e30b244d2f4fc99428ee285 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 31 Oct 2019 16:21:27 +1100 Subject: Add Tx.Return and a return value from Atomically --- tx.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tx.go') diff --git a/tx.go b/tx.go index c2dcbdc..123c490 100644 --- a/tx.go +++ b/tx.go @@ -73,3 +73,11 @@ func (tx *Tx) Assert(p bool) { tx.Retry() } } + +func (tx *Tx) Return(v interface{}) { + panic(_return{v}) +} + +type _return struct { + value interface{} +} -- cgit v1.2.3