Skip to content

fix(snmp): satisfy lint checks in resilience code - #1490

Merged
kongfei605 merged 1 commit into
flashcatcloud:mainfrom
kongfei605:snmp_fix
Aug 4, 2026
Merged

fix(snmp): satisfy lint checks in resilience code#1490
kongfei605 merged 1 commit into
flashcatcloud:mainfrom
kongfei605:snmp_fix

Conversation

@kongfei605

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings August 4, 2026 03:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the SNMP input’s resilience/health-check and filter parsing code to satisfy lint checks, primarily by removing unused helpers and addressing “replace with -1” / unchecked-return patterns.

Changes:

  • Replaced strings.Replace(..., -1) with strings.ReplaceAll in SNMP table filter parsing.
  • Updated the recovery probe to defer-close the SNMP wrapper while explicitly ignoring the close error (to satisfy errcheck-style linters).
  • Removed unused helper methods in SNMP table/runtime/dependency cache code.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
inputs/snmp/table.go Uses strings.ReplaceAll in filter parsing and removes an unused filter-dependency helper.
inputs/snmp/runtime.go Removes an unused recordSuccess() wrapper (callers use the locked variant).
inputs/snmp/health_check.go Wraps defer gs.Close() to explicitly ignore the returned error.
inputs/snmp/dependency_cache.go Removes an unused clear() method wrapper (nil-check + lock + clearLocked).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kongfei605
kongfei605 merged commit 30a84e3 into flashcatcloud:main Aug 4, 2026
3 checks passed
@kongfei605
kongfei605 deleted the snmp_fix branch August 4, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants