From 4abf680c76151da0f4a9086d44abad655cb1f01e Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 29 Sep 2017 13:27:49 -0700 Subject: [PATCH] registry: feed the linter by removing redundant err check Signed-off-by: Stephen J Day --- registry/api/errcode/handler.go | 6 +----- registry/proxy/proxyauth.go | 6 +----- registry/storage/blobwriter.go | 6 +----- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/registry/api/errcode/handler.go b/registry/api/errcode/handler.go index 49a64a86e..d77e70473 100644 --- a/registry/api/errcode/handler.go +++ b/registry/api/errcode/handler.go @@ -36,9 +36,5 @@ func ServeJSON(w http.ResponseWriter, err error) error { w.WriteHeader(sc) - if err := json.NewEncoder(w).Encode(err); err != nil { - return err - } - - return nil + return json.NewEncoder(w).Encode(err) } diff --git a/registry/proxy/proxyauth.go b/registry/proxy/proxyauth.go index 7b405afcf..09a0973e6 100644 --- a/registry/proxy/proxyauth.go +++ b/registry/proxy/proxyauth.go @@ -79,9 +79,5 @@ func ping(manager challenge.Manager, endpoint, versionHeader string) error { } defer resp.Body.Close() - if err := manager.AddResponse(resp); err != nil { - return err - } - - return nil + return manager.AddResponse(resp) } diff --git a/registry/storage/blobwriter.go b/registry/storage/blobwriter.go index d56f28749..2bb25dcc5 100644 --- a/registry/storage/blobwriter.go +++ b/registry/storage/blobwriter.go @@ -104,11 +104,7 @@ func (bw *blobWriter) Cancel(ctx context.Context) error { dcontext.GetLogger(ctx).Errorf("error closing blobwriter: %s", err) } - if err := bw.removeResources(ctx); err != nil { - return err - } - - return nil + return bw.removeResources(ctx) } func (bw *blobWriter) Size() int64 {