diff --git a/daemon/checkpoint.go b/daemon/checkpoint.go index 1c850b335b..3ec581e5fc 100644 --- a/daemon/checkpoint.go +++ b/daemon/checkpoint.go @@ -35,16 +35,16 @@ func getCheckpointDir(checkDir, checkpointID, ctrName, ctrID, ctrCheckpointDir s err2 = os.MkdirAll(checkpointAbsDir, 0700) case err != nil: err2 = err - case err == nil: + default: err2 = fmt.Errorf("%s exists and is not a directory", checkpointAbsDir) } } else { switch { case err != nil: err2 = fmt.Errorf("checkpoint %s does not exist for container %s", checkpointID, ctrName) - case err == nil && stat.IsDir(): + case stat.IsDir(): err2 = nil - case err == nil: + default: err2 = fmt.Errorf("%s exists and is not a directory", checkpointAbsDir) } }