From 82a04398a34ea188febf132776e9e95c705b3e8d Mon Sep 17 00:00:00 2001 From: Tuomas Silen Date: Tue, 15 Sep 2015 11:18:43 +0300 Subject: [PATCH] Rename error return var --- physical/etcd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physical/etcd.go b/physical/etcd.go index 920a95a572..a299293de4 100644 --- a/physical/etcd.go +++ b/physical/etcd.go @@ -351,7 +351,7 @@ func (c *EtcdLock) watchForKeyRemoval(key string, etcdIndex uint64, closeCh chan // // If the lock is currently held by this instance of EtcdLock, Lock will // return an EtcdLockHeldError error. -func (c *EtcdLock) Lock(stopCh <-chan struct{}) (doneCh <-chan struct{}, err error) { +func (c *EtcdLock) Lock(stopCh <-chan struct{}) (doneCh <-chan struct{}, retErr error) { // Get the local lock before interacting with etcd. c.lock.Lock() defer c.lock.Unlock() @@ -385,7 +385,7 @@ func (c *EtcdLock) Lock(stopCh <-chan struct{}) (doneCh <-chan struct{}, err err // Create a channel to signal when we lose the semaphore key. done := make(chan struct{}) defer func() { - if err != nil { + if retErr != nil { close(done) } }()