code cleanup

clean up code identified as problematic by golands inspection

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude
2019-07-03 15:37:17 -05:00
parent f7407f2eb5
commit 1d36501f96
19 changed files with 122 additions and 140 deletions

View File

@ -89,13 +89,13 @@ func getTestContainer(id, name string, manager lock.Manager) (*Container, error)
ctr.config.Labels["test"] = "testing"
// Allocate a lock for the container
lock, err := manager.AllocateLock()
// Allocate a containerLock for the container
containerLock, err := manager.AllocateLock()
if err != nil {
return nil, err
}
ctr.lock = lock
ctr.config.LockID = lock.ID()
ctr.lock = containerLock
ctr.config.LockID = containerLock.ID()
return ctr, nil
}
@ -114,13 +114,13 @@ func getTestPod(id, name string, manager lock.Manager) (*Pod, error) {
valid: true,
}
// Allocate a lock for the pod
lock, err := manager.AllocateLock()
// Allocate a podLock for the pod
podLock, err := manager.AllocateLock()
if err != nil {
return nil, err
}
pod.lock = lock
pod.config.LockID = lock.ID()
pod.lock = podLock
pod.config.LockID = podLock.ID()
return pod, nil
}