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:
Sebastiaan van Stijn
2025-06-10 13:54:56 +02:00
parent 0069360e3b
commit 23c56099ee

View File

@@ -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
}