From 67165b76753f65b6f58d471f314678ae12a4c722 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 13 Jan 2020 13:01:45 +0100 Subject: make lint: enable gocritic `gocritic` is a powerful linter that helps in preventing certain kinds of errors as well as enforcing a coding style. Signed-off-by: Valentin Rothberg --- libpod/runtime_pod_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libpod/runtime_pod_linux.go') diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index 563d9728a..450c64d24 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -19,7 +19,7 @@ import ( ) // NewPod makes a new, empty pod -func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (_ *Pod, Err error) { +func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (_ *Pod, deferredErr error) { r.lock.Lock() defer r.lock.Unlock() @@ -65,7 +65,7 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (_ *Po pod.config.LockID = pod.lock.ID() defer func() { - if Err != nil { + if deferredErr != nil { if err := pod.lock.Free(); err != nil { logrus.Errorf("Error freeing pod lock after failed creation: %v", err) } @@ -126,7 +126,7 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (_ *Po return nil, errors.Wrapf(err, "error adding pod to state") } defer func() { - if Err != nil { + if deferredErr != nil { if err := r.removePod(ctx, pod, true, true); err != nil { logrus.Errorf("Error removing pod after pause container creation failure: %v", err) } -- cgit v1.2.3-54-g00ecf