logger/journald: fix SA4011: ineffective break statement
This was introduced in906b979b88
, which changed a `goto` to a `break`, but afaics, the intent was still to break out of the loop. (linter didn't catch this before because it didn't have the right build-tag set) daemon/logger/journald/read.go:238:4: SA4011: ineffective break statement. Did you mean to break out of the outer loop? (staticcheck) break // won't be able to write anything anymore ^ Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit75577fe7a8
) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
48a144954e
commit
a9081299dd
1 changed files with 2 additions and 1 deletions
|
@ -227,6 +227,7 @@ func (s *journald) followJournal(logWatcher *logger.LogWatcher, j *C.sd_journal,
|
|||
|
||||
waitTimeout := C.uint64_t(250000) // 0.25s
|
||||
|
||||
LOOP:
|
||||
for {
|
||||
status := C.sd_journal_wait(j, waitTimeout)
|
||||
if status < 0 {
|
||||
|
@ -235,7 +236,7 @@ func (s *journald) followJournal(logWatcher *logger.LogWatcher, j *C.sd_journal,
|
|||
}
|
||||
select {
|
||||
case <-logWatcher.WatchConsumerGone():
|
||||
break // won't be able to write anything anymore
|
||||
break LOOP // won't be able to write anything anymore
|
||||
case <-s.closed:
|
||||
// container is gone, drain journal
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue