Skip to content

Fix gosec G118 false positive in streamStore.Start#6

Merged
dmortondev merged 1 commit intomainfrom
misc-linter-fix
Mar 7, 2026
Merged

Fix gosec G118 false positive in streamStore.Start#6
dmortondev merged 1 commit intomainfrom
misc-linter-fix

Conversation

@dmortondev
Copy link
Copy Markdown
Collaborator

Summary

  • Fix lint failure on main caused by new gosec G118 rule in golangci-lint v2.11.1
  • Add //nolint:gosec directive to streamStore.Start() where context.WithCancel cancel func is stored in a struct field and called later in Cancel()

Context

CI uses version: latest for golangci-lint. A new upstream release introduced the G118 rule (context cancellation function not called) between when PR #5 was checked and when its merge commit was checked on main. This is a false positive — the cancel function is stored in streamRecord.Cancel and invoked in streamStore.Cancel().

Test plan

  • just lint passes locally with golangci-lint v2.11.1

The cancel function is stored in the streamRecord struct and called
in Cancel(). Suppress the lint warning with a nolint directive.
@dmortondev dmortondev merged commit ecf49b4 into main Mar 7, 2026
11 checks passed
@dmortondev dmortondev deleted the misc-linter-fix branch March 7, 2026 03:33
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.

1 participant