lint: revive/useless-break (#3050)

This commit is contained in:
mmetc 2024-06-04 09:48:21 +02:00 committed by GitHub
parent 7313d49145
commit fba4237fbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 8 deletions

View file

@ -11,12 +11,11 @@ import (
)
func runParse(input chan types.Event, output chan types.Event, parserCTX parser.UnixParserCtx, nodes []parser.Node) error {
LOOP:
for {
select {
case <-parsersTomb.Dying():
log.Infof("Killing parser routines")
break LOOP
return nil
case event := <-input:
if !event.Process {
continue
@ -55,6 +54,4 @@ LOOP:
output <- parsed
}
}
return nil
}

View file

@ -26,8 +26,7 @@ func (s *SimulationConfig) IsSimulated(scenario string) bool {
for _, excluded := range s.Exclusions {
if excluded == scenario {
simulated = !simulated
break
return !simulated
}
}

View file

@ -103,7 +103,6 @@ func (pb *PluginBroker) Kill() {
func (pb *PluginBroker) Run(pluginTomb *tomb.Tomb) {
//we get signaled via the channel when notifications need to be delivered to plugin (via the watcher)
pb.watcher.Start(&tomb.Tomb{})
loop:
for {
select {
case profileAlert := <-pb.PluginChannel:
@ -137,7 +136,7 @@ loop:
case <-pb.watcher.tomb.Dead():
log.Info("killing all plugins")
pb.Kill()
break loop
return
case pluginName := <-pb.watcher.PluginEvents:
// this can be run in goroutine, but then locks will be needed
pluginMutex.Lock()