summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/container_inspect.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/container_inspect.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/container_inspect.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/container_inspect.go b/vendor/github.com/fsouza/go-dockerclient/container_inspect.go
index e8091f739..48c1e8ea7 100644
--- a/vendor/github.com/fsouza/go-dockerclient/container_inspect.go
+++ b/vendor/github.com/fsouza/go-dockerclient/container_inspect.go
@@ -3,6 +3,7 @@ package docker
import (
"context"
"encoding/json"
+ "errors"
"net/http"
)
@@ -17,7 +18,6 @@ func (c *Client) InspectContainer(id string) (*Container, error) {
// The context object can be used to cancel the inspect request.
//
// Deprecated: Use InspectContainerWithOptions instead.
-//nolint:golint
func (c *Client) InspectContainerWithContext(id string, ctx context.Context) (*Container, error) {
return c.InspectContainerWithOptions(InspectContainerOptions{ID: id, Context: ctx})
}
@@ -31,7 +31,8 @@ func (c *Client) InspectContainerWithOptions(opts InspectContainerOptions) (*Con
context: opts.Context,
})
if err != nil {
- if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
+ var e *Error
+ if errors.As(err, &e) && e.Status == http.StatusNotFound {
return nil, &NoSuchContainer{ID: opts.ID}
}
return nil, err