style: fix revive linter warnings

- Mark unused stub parameters with underscore
- Rename 'copy' variable to avoid shadowing builtin
- Remove unnecessary else blocks after return statements
This commit is contained in:
rcourtman 2025-11-27 10:26:26 +00:00
parent 1fb4a2c2c6
commit 67b60adb65
3 changed files with 15 additions and 16 deletions

View file

@ -8,6 +8,6 @@ import (
) )
// runAsWindowsService is a no-op on non-Windows platforms // runAsWindowsService is a no-op on non-Windows platforms
func runAsWindowsService(cfg hostagent.Config, logger zerolog.Logger) error { func runAsWindowsService(_ hostagent.Config, _ zerolog.Logger) error {
return nil return nil
} }

View file

@ -7582,8 +7582,8 @@ func cloneStringPtr(value *string) *string {
if value == nil { if value == nil {
return nil return nil
} }
copy := *value v := *value
return &copy return &v
} }
func cloneThresholdConfig(cfg ThresholdConfig) ThresholdConfig { func cloneThresholdConfig(cfg ThresholdConfig) ThresholdConfig {
@ -7972,14 +7972,14 @@ func (m *Manager) evaluateFilterStack(guest interface{}, stack FilterStack) bool
} }
} }
return true return true
} else { // OR
for _, result := range results {
if result {
return true
}
}
return false
} }
// OR
for _, result := range results {
if result {
return true
}
}
return false
} }
// getGuestThresholds returns the appropriate thresholds for a guest // getGuestThresholds returns the appropriate thresholds for a guest

View file

@ -290,13 +290,12 @@ func CheckAuth(cfg *config.Config, w http.ResponseWriter, r *http.Request) bool
// Use ValidateAndExtendSession for sliding expiration // Use ValidateAndExtendSession for sliding expiration
if ValidateAndExtendSession(cookie.Value) { if ValidateAndExtendSession(cookie.Value) {
return true return true
} else {
// Debug logging for failed session validation
log.Debug().
Str("session_token", cookie.Value[:8]+"...").
Str("path", r.URL.Path).
Msg("Session validation failed - token not found or expired")
} }
// Debug logging for failed session validation
log.Debug().
Str("session_token", cookie.Value[:8]+"...").
Str("path", r.URL.Path).
Msg("Session validation failed - token not found or expired")
} else if err != nil { } else if err != nil {
// Debug logging when no session cookie found // Debug logging when no session cookie found
log.Debug(). log.Debug().