From 89e6568e34ce56cd447558651e6d3e7fd96d0363 Mon Sep 17 00:00:00 2001 From: Manish Tomar Date: Mon, 4 Feb 2019 16:42:44 -0800 Subject: [PATCH] Remove err nil check since type checking nil will not panic and return appropriately Signed-off-by: Manish Tomar Signed-off-by: wang yan --- registry/storage/garbagecollect.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/registry/storage/garbagecollect.go b/registry/storage/garbagecollect.go index 48d428a88e..317c792da5 100644 --- a/registry/storage/garbagecollect.go +++ b/registry/storage/garbagecollect.go @@ -98,15 +98,13 @@ func MarkAndSweep(ctx context.Context, storageDriver driver.StorageDriver, regis return nil }) - if err != nil { - // In certain situations such as unfinished uploads, deleting all - // tags in S3 or removing the _manifests folder manually, this - // error may be of type PathNotFound. - // - // In these cases we can continue marking other manifests safely. - if _, ok := err.(driver.PathNotFoundError); ok { - return nil - } + // In certain situations such as unfinished uploads, deleting all + // tags in S3 or removing the _manifests folder manually, this + // error may be of type PathNotFound. + // + // In these cases we can continue marking other manifests safely. + if _, ok := err.(driver.PathNotFoundError); ok { + return nil } return err