Skip to content

Commit

Permalink
Remove err nil check
Browse files Browse the repository at this point in the history
since type checking nil will not panic and return appropriately

Signed-off-by: Manish Tomar <manish.tomar@docker.com>
  • Loading branch information
Manish Tomar authored and wy65701436 committed Mar 23, 2021
1 parent 6d972c6 commit 3d5538e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions registry/storage/garbagecollect.go
Expand Up @@ -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
Expand Down

0 comments on commit 3d5538e

Please sign in to comment.