mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +08:00
linter: enable nilerr
A number of cases looked suspicious, so I marked them with `FIXME`s to leave some breadcrumbs. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@@ -99,13 +99,12 @@ func CRRemoveDeletedFiles(id, baseDirectory, containerRootDirectory string) erro
|
||||
// root file system changes on top of containerRootDirectory
|
||||
func CRApplyRootFsDiffTar(baseDirectory, containerRootDirectory string) error {
|
||||
rootfsDiffPath := filepath.Join(baseDirectory, metadata.RootFsDiffTar)
|
||||
if _, err := os.Stat(rootfsDiffPath); err != nil {
|
||||
// Only do this if a rootfs-diff.tar actually exists
|
||||
return nil
|
||||
}
|
||||
|
||||
// Only do this if a rootfs-diff.tar actually exists
|
||||
rootfsDiffFile, err := os.Open(rootfsDiffPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, "failed to open root file-system diff file")
|
||||
}
|
||||
defer rootfsDiffFile.Close()
|
||||
|
||||
Reference in New Issue
Block a user