From f361d443b7d4e77a3da22112b5ab6426bec4f6f4 Mon Sep 17 00:00:00 2001 From: zhipengzuo Date: Wed, 22 Jul 2020 10:54:46 +0800 Subject: [PATCH] clean up code because err is always nil Signed-off-by: zhipengzuo --- registry/proxy/proxyblobstore.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/registry/proxy/proxyblobstore.go b/registry/proxy/proxyblobstore.go index 9ca9c968..bc13a34b 100644 --- a/registry/proxy/proxyblobstore.go +++ b/registry/proxy/proxyblobstore.go @@ -72,13 +72,8 @@ func (pbs *proxyBlobStore) serveLocal(ctx context.Context, w http.ResponseWriter return false, nil } - if err == nil { - proxyMetrics.BlobPush(uint64(localDesc.Size)) - return true, pbs.localStore.ServeBlob(ctx, w, r, dgst) - } - - return false, nil - + proxyMetrics.BlobPush(uint64(localDesc.Size)) + return true, pbs.localStore.ServeBlob(ctx, w, r, dgst) } func (pbs *proxyBlobStore) storeLocal(ctx context.Context, dgst digest.Digest) error {