mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
if-return: redundant if ...; err != nil check (revive)
builder/builder-next/adapters/snapshot/snapshot.go:386:3: if-return: redundant if ...; err != nil check, just return error instead. (revive)
if err := b.Put(keyIsCommitted, []byte{}); err != nil {
return err
}
plugin/fetch_linux.go:112:2: if-return: redundant if ...; err != nil check, just return error instead. (revive)
if err := images.Dispatch(ctx, images.Handlers(handlers...), nil, desc); err != nil {
return err
}
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit dd1374f7b2
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
9e88f8435a
commit
45fa675a35
2 changed files with 2 additions and 8 deletions
|
@ -383,10 +383,7 @@ func (s *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := b.Put(keyIsCommitted, []byte{}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return b.Put(keyIsCommitted, []byte{})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -109,10 +109,7 @@ func (pm *Manager) fetch(ctx context.Context, ref reference.Named, auth *types.A
|
|||
|
||||
fp := withFetchProgress(pm.blobStore, out, ref)
|
||||
handlers = append([]images.Handler{fp, remotes.FetchHandler(pm.blobStore, fetcher)}, handlers...)
|
||||
if err := images.Dispatch(ctx, images.Handlers(handlers...), nil, desc); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return images.Dispatch(ctx, images.Handlers(handlers...), nil, desc)
|
||||
}
|
||||
|
||||
// applyLayer makes an images.HandlerFunc which applies a fetched image rootfs layer to a directory.
|
||||
|
|
Loading…
Reference in a new issue