From b206afc4a74ac026eb5d497398732ee64dc0e493 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 22 Aug 2017 18:00:20 -0700 Subject: [PATCH] concurrency: fix STM example to add to balance Worked by coincidence; the txn would always retry and there was a 1/10 chance it would pass by selecting the same to/from keys. --- clientv3/concurrency/example_stm_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientv3/concurrency/example_stm_test.go b/clientv3/concurrency/example_stm_test.go index d49862c7d..54c871d36 100644 --- a/clientv3/concurrency/example_stm_test.go +++ b/clientv3/concurrency/example_stm_test.go @@ -58,7 +58,7 @@ func ExampleSTM_apply() { // transfer amount xfer := fromInt / 2 - fromInt, toInt = fromInt-xfer, toInt-xfer + fromInt, toInt = fromInt-xfer, toInt+xfer // writeback stm.Put(fromK, fmt.Sprintf("%d", fromInt))