mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
lint: revive/useless-break (#3050)
This commit is contained in:
parent
7313d49145
commit
fba4237fbd
3 changed files with 3 additions and 8 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ func (s *SimulationConfig) IsSimulated(scenario string) bool {
|
|||
|
||||
for _, excluded := range s.Exclusions {
|
||||
if excluded == scenario {
|
||||
simulated = !simulated
|
||||
break
|
||||
return !simulated
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue