lint/gocritic: enable importShadow, typeUnparen, unnecessaryDefer (#3583)

This commit is contained in:
mmetc 2025-04-24 11:12:38 +02:00 committed by GitHub
parent 34e306505c
commit 418a27596e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 62 additions and 65 deletions

View file

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