Skip to content

[lint-monster] lint-monster: Context & Resource Management #40210

Description

@github-actions

Context & Resource Management, Error Handling

Summary: 9 custom linter findings related to improper resource deferred cleanup, context handling, and error checking.

Affected Files:

  • pkg/workflow/action_resolver.go:229 - context cancel function should be deferred immediately
  • pkg/workflow/action_resolver.go:38 - map[string]bool should use map[string]struct{} (set type)
  • pkg/parser/remote_fetch.go:586 - use exec.CommandContext instead of exec.Command
  • pkg/cli/token_usage.go:561 - file Close() should be deferred immediately
  • pkg/cli/mcp_inspect.go:138 - use select with ctx.Done() instead of time.Sleep
  • pkg/cli/logs_awinfo_backward_compat_test.go:173,182 - json.Unmarshal error discarded
  • pkg/parser/json_path_locator_test.go:141 - json.Unmarshal error discarded
  • pkg/workflow/dependabot_test.go:607 - json.Unmarshal error discarded

Expected Outcome: All resource management issues fixed, proper error handling in place, context properly propagated.

Remediation Checklist:

  • Defer context cancel immediately in action_resolver.go line 229
  • Change map[string]bool to map[string]struct{} in action_resolver.go line 38
  • Replace exec.Command with exec.CommandContext in remote_fetch.go line 586
  • Defer file Close() in token_usage.go line 561
  • Use ctx.Done() with select instead of time.Sleep in mcp_inspect.go line 138
  • Handle json.Unmarshal errors in test files
  • Verify with make golint-custom

Generated by 🧌 LintMonster · 14.1 AIC · ⌖ 8.84 AIC · ⊞ 4.7K ·

  • expires on Jun 25, 2026, 7:51 PM UTC-08:00

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions