Skip to content

Fix staticcheck SA9003: Replace empty if blocks with explicit error discard#154

Merged
pelikhan merged 2 commits into
copilot/add-second-log-file-writerfrom
copilot/fix-linter-issues
Jan 11, 2026
Merged

Fix staticcheck SA9003: Replace empty if blocks with explicit error discard#154
pelikhan merged 2 commits into
copilot/add-second-log-file-writerfrom
copilot/fix-linter-issues

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 11, 2026

The staticcheck linter (SA9003) flagged three empty if blocks in internal/logger/markdown_logger.go where Sync() errors were being silently ignored.

Changes

  • Replaced empty if blocks with explicit _ = err pattern (idiomatic Go for intentional error discard)
  • Affected locations: lines 103, 108, and 186 in markdown_logger.go

Before:

if err := ml.logFile.Sync(); err != nil {
    // Ignore sync errors
}

After:

_ = ml.logFile.Sync() // Ignore sync errors

Behavior is unchanged - errors are still intentionally ignored in all three locations.

Original prompt

Reference: https://github.com/githubnext/gh-aw-mcpg/actions/runs/20896724928/job/60036773633#step:6:1

Fix linter issues


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix linter issues Fix staticcheck SA9003: Replace empty if blocks with explicit error discard Jan 11, 2026
Copilot AI requested a review from pelikhan January 11, 2026 14:51
@pelikhan pelikhan marked this pull request as ready for review January 11, 2026 14:52
@pelikhan pelikhan merged commit d989b0e into copilot/add-second-log-file-writer Jan 11, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/fix-linter-issues branch January 11, 2026 14:53
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