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