Skip to content

Commit

Permalink
SA1019: httputil.ErrPersistEOF is deprecated: No longer used. (static…
Browse files Browse the repository at this point in the history
…check)

Signed-off-by: Silvin Lubecki <[email protected]>
  • Loading branch information
silvin-lubecki authored and thaJeztah committed Oct 31, 2019
1 parent 7da9360 commit 3a42820
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions cli/command/container/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"net/http/httputil"

"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 1 addition & 5 deletions cli/command/container/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"net/http/httputil"
"os"
"runtime"
"strings"
Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 1 addition & 5 deletions cli/command/container/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"net/http/httputil"
"strings"

"github.com/docker/cli/cli"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 3a42820

Please sign in to comment.