mirror of
https://github.com/moby/moby.git
synced 2026-08-04 23:21:00 +00:00
daemon/logger/loggerutils: use defer to fix gocritic "badlock" linter
daemon/logger/loggerutils/logfile.go:374:2: badLock: defer is missing, mutex is unlocked immediately (gocritic)
w.rotateMu.Unlock()
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -371,7 +371,7 @@ func (w *LogFile) Close() error {
|
||||
close(w.closed)
|
||||
// Wait until any in-progress rotation is complete.
|
||||
w.rotateMu.Lock()
|
||||
w.rotateMu.Unlock() //nolint:staticcheck,gocritic
|
||||
defer w.rotateMu.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user