Rename error return var

This commit is contained in:
Tuomas Silen 2015-09-15 11:18:43 +03:00
parent e92001ca69
commit 82a04398a3

View file

@ -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)
}
}()