mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon/checkpoint: rm extra checks
In this code, err is already checked to be nil (or non-nil), so no need to repeat extra checks. Fixes the following govet warnings: > daemon/checkpoint.go:38:12: nilness: tautological condition: nil == nil (govet) > case err == nil: > ^ > daemon/checkpoint.go:45:12: nilness: tautological condition: nil == nil (govet) > case err == nil && stat.IsDir(): > ^ > daemon/checkpoint.go:47:12: nilness: tautological condition: nil == nil (govet) > case err == nil: > ^ Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
3ef7f7c650
commit
58ac4bd938
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue