mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
lint/gocritic: enable importShadow, typeUnparen, unnecessaryDefer (#3583)
This commit is contained in:
parent
34e306505c
commit
418a27596e
17 changed files with 62 additions and 65 deletions
|
@ -92,17 +92,18 @@ func (pw *PluginWatcher) watchPluginTicker(pluginName string) {
|
|||
threshold := pw.PluginConfigByName[pluginName].GroupThreshold
|
||||
|
||||
//only size is set
|
||||
if threshold > 0 && interval == 0 {
|
||||
switch {
|
||||
case threshold > 0 && interval == 0:
|
||||
watchCount = threshold
|
||||
watchTime = DefaultEmptyTicker
|
||||
} else if interval != 0 && threshold == 0 {
|
||||
case interval != 0 && threshold == 0:
|
||||
//only time is set
|
||||
watchTime = interval
|
||||
} else if interval != 0 && threshold != 0 {
|
||||
case interval != 0 && threshold != 0:
|
||||
//both are set
|
||||
watchTime = DefaultEmptyTicker
|
||||
watchCount = threshold
|
||||
} else {
|
||||
default:
|
||||
//none are set, we sent every event we receive
|
||||
watchTime = DefaultEmptyTicker
|
||||
watchCount = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue