logger/journald: fix SA4011: ineffective break statement

This was introduced in 906b979b88, 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>
This commit is contained in:
Sebastiaan van Stijn 2022-07-20 15:14:04 +02:00
parent 2fbc30739b
commit 75577fe7a8
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 1 deletions

View File

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