From b9628637c3ad1434bd8cc642327bf8fb02d367f1 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 d49862c7db53..54c871d364cd 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))