mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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:
parent
2fbc30739b
commit
75577fe7a8
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…
Reference in a new issue