From 77b5d25dfb36b3d2f290e5d6e6dba10f37a13b54 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Mon, 11 Sep 2023 08:30:12 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Manuel de la Peña --- docker.go | 4 ++-- wait/host_port.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker.go b/docker.go index 516673f8e1..0ba0f98b65 100644 --- a/docker.go +++ b/docker.go @@ -795,7 +795,7 @@ func (p *DockerProvider) BuildImage(ctx context.Context, img ImageBuildInfo) (st resp, err = p.client.ImageBuild(ctx, buildContext, buildOptions) if err != nil { var enf errdefs.ErrNotFound - if ok := errors.As(err, &enf); ok { + if errors.As(err, &enf) { return backoff.Permanent(err) } Logger.Printf("Failed to build image: %s, will retry", err) @@ -1163,7 +1163,7 @@ func (p *DockerProvider) attemptToPullImage(ctx context.Context, tag string, pul pull, err = p.client.ImagePull(ctx, tag, pullOpt) if err != nil { var enf errdefs.ErrNotFound - if ok := errors.As(err, &enf); ok { + if errors.As(err, &enf) { return backoff.Permanent(err) } Logger.Printf("Failed to pull image: %s, will retry", err) diff --git a/wait/host_port.go b/wait/host_port.go index 42e49ca034..2d150c1c11 100644 --- a/wait/host_port.go +++ b/wait/host_port.go @@ -156,9 +156,9 @@ func externalCheck(ctx context.Context, ipAddress string, port nat.Port, target conn, err := dialer.DialContext(ctx, proto, address) if err != nil { var v *net.OpError - if ok := errors.As(err, &v); ok { + if errors.As(err, &v) { var v2 *os.SyscallError - if ok := errors.As(v.Err, &v2); ok { + if errors.As(v.Err, &v2) { if isConnRefusedErr(v2.Err) { time.Sleep(waitInterval) continue