mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
enable errcheck linter
The errcheck linter makes sure that errors are always check and not ignored by accident. It spotted a lot of unchecked errors, mostly in the tests but also some real problem in the code. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -55,8 +55,11 @@ func WaitForFile(path string, chWait chan error, timeout time.Duration) (bool, e
|
||||
if err := watcher.Add(filepath.Dir(path)); err == nil {
|
||||
inotifyEvents = watcher.Events
|
||||
}
|
||||
defer watcher.Close()
|
||||
defer watcher.Remove(filepath.Dir(path))
|
||||
defer func() {
|
||||
if err := watcher.Close(); err != nil {
|
||||
logrus.Errorf("Failed to close fsnotify watcher: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
var timeoutChan <-chan time.Time
|
||||
|
Reference in New Issue
Block a user