mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-10 18:00:18 +08:00
Enable govet nilness, fix an issue
The code already checked if err == nil above, so the linter complains: > libcontainer/container_linux.go:534:18: nilness: tautological condition: non-nil != nil (govet) > } else if err != nil { > ^ Fix the issue, enable the check. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -11,3 +11,8 @@ linters:
|
|||||||
- errorlint
|
- errorlint
|
||||||
- unconvert
|
- unconvert
|
||||||
- unparam
|
- unparam
|
||||||
|
|
||||||
|
linters-settings:
|
||||||
|
govet:
|
||||||
|
enable:
|
||||||
|
- nilness
|
||||||
|
@@ -531,7 +531,7 @@ func (c *Container) newParentProcess(p *Process) (parentProcess, error) {
|
|||||||
logrus.Debug("runc-dmz: using runc-dmz") // used for tests
|
logrus.Debug("runc-dmz: using runc-dmz") // used for tests
|
||||||
} else if errors.Is(err, dmz.ErrNoDmzBinary) {
|
} else if errors.Is(err, dmz.ErrNoDmzBinary) {
|
||||||
logrus.Debug("runc-dmz binary not embedded in runc binary, falling back to /proc/self/exe clone")
|
logrus.Debug("runc-dmz binary not embedded in runc binary, falling back to /proc/self/exe clone")
|
||||||
} else if err != nil {
|
} else {
|
||||||
return nil, fmt.Errorf("failed to create runc-dmz binary clone: %w", err)
|
return nil, fmt.Errorf("failed to create runc-dmz binary clone: %w", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user