From 7b82576b606d1433c940af3efc720e160f3e8fb3 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Sat, 20 Feb 2016 22:01:33 -0800 Subject: [PATCH] clientv3: copy correct pointers into txn comparisons Was copying the range variable's pointer; all elements of cmp were the same. --- clientv3/txn.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientv3/txn.go b/clientv3/txn.go index 170fa6ba7..6e80dbb74 100644 --- a/clientv3/txn.go +++ b/clientv3/txn.go @@ -85,8 +85,8 @@ func (txn *txn) If(cs ...Cmp) Txn { txn.cif = true - for _, cmp := range cs { - txn.cmps = append(txn.cmps, (*pb.Compare)(&cmp)) + for i := range cs { + txn.cmps = append(txn.cmps, (*pb.Compare)(&cs[i])) } return txn