From 3a428202bf1194681374cd34eee92f109e8a8ca7 Mon Sep 17 00:00:00 2001 From: Silvin Lubecki Date: Tue, 2 Apr 2019 11:20:07 +0200 Subject: [PATCH] SA1019: httputil.ErrPersistEOF is deprecated: No longer used. (staticcheck) Signed-off-by: Silvin Lubecki --- cli/command/container/attach.go | 6 +----- cli/command/container/run.go | 6 +----- cli/command/container/start.go | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/cli/command/container/attach.go b/cli/command/container/attach.go index de96a3b7d8..f2bcfb0256 100644 --- a/cli/command/container/attach.go +++ b/cli/command/container/attach.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "net/http/httputil" "github.com/docker/cli/cli" "github.com/docker/cli/cli/command" @@ -103,10 +102,7 @@ func runAttach(dockerCli command.Cli, opts *attachOptions) error { } resp, errAttach := client.ContainerAttach(ctx, opts.container, options) - if errAttach != nil && errAttach != httputil.ErrPersistEOF { - // ContainerAttach returns an ErrPersistEOF (connection closed) - // means server met an error and put it in Hijacked connection - // keep the error and read detailed error message from hijacked connection later + if errAttach != nil { return errAttach } defer resp.Close() diff --git a/cli/command/container/run.go b/cli/command/container/run.go index c7f51f3dcc..1b0b76770c 100644 --- a/cli/command/container/run.go +++ b/cli/command/container/run.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "net/http/httputil" "os" "runtime" "strings" @@ -250,10 +249,7 @@ func attachContainer( } resp, errAttach := dockerCli.Client().ContainerAttach(ctx, containerID, options) - if errAttach != nil && errAttach != httputil.ErrPersistEOF { - // ContainerAttach returns an ErrPersistEOF (connection closed) - // means server met an error and put it in Hijacked connection - // keep the error and read detailed error message from hijacked connection later + if errAttach != nil { return nil, errAttach } diff --git a/cli/command/container/start.go b/cli/command/container/start.go index e388302841..10661768ac 100644 --- a/cli/command/container/start.go +++ b/cli/command/container/start.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "io" - "net/http/httputil" "strings" "github.com/docker/cli/cli" @@ -98,10 +97,7 @@ func runStart(dockerCli command.Cli, opts *startOptions) error { } resp, errAttach := dockerCli.Client().ContainerAttach(ctx, c.ID, options) - if errAttach != nil && errAttach != httputil.ErrPersistEOF { - // ContainerAttach return an ErrPersistEOF (connection closed) - // means server met an error and already put it in Hijacked connection, - // we would keep the error and read the detailed error message from hijacked connection + if errAttach != nil { return errAttach } defer resp.Close()