Skip to content

Remove unused fields from handlerCapture test struct - #1242

Merged
lpcox merged 2 commits into
copilot/add-serena-tools-for-language-supportfrom
copilot/fix-github-actions-lint-another-one
Feb 21, 2026
Merged

Remove unused fields from handlerCapture test struct#1242
lpcox merged 2 commits into
copilot/add-serena-tools-for-language-supportfrom
copilot/fix-github-actions-lint-another-one

Conversation

Copilot AI commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

golangci-lint (unused linter) was failing CI due to two struct fields in a test helper that were never read or written.

Change

Removed statusCode and responseBody from handlerCapture in internal/server/sdk_logging_test.go — these values are passed as parameters to makeInnerHandler but were never stored back onto the struct.

// before
type handlerCapture struct {
    called       bool
    body         []byte
    statusCode   int   // never set or read
    responseBody []byte // never set or read
}

// after
type handlerCapture struct {
    called bool
    body   []byte
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build3958490663/b275/launcher.test /tmp/go-build3958490663/b275/launcher.test -test.testlogfile=/tmp/go-build3958490663/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -c=4 -nolocalimports -importcfg /tmp/go-build3958490663/b232/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/santhosh-tekuri/jsonschema/v5@v5.3.1/compiler.go /home/REDACTED/go/pkg/mod/github.com/santhosh-tekuri/jsonschema/v5@v5.3.1/content.go conf�� go user.name git (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build3958490663/b260/config.test /tmp/go-build3958490663/b260/config.test -test.testlogfile=/tmp/go-build3958490663/b260/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go base64/base64.go-imultiarch 64/pkg/tool/linux86_64-linux-gnu r (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build3958490663/b275/launcher.test /tmp/go-build3958490663/b275/launcher.test -test.testlogfile=/tmp/go-build3958490663/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -c=4 -nolocalimports -importcfg /tmp/go-build3958490663/b232/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/santhosh-tekuri/jsonschema/v5@v5.3.1/compiler.go /home/REDACTED/go/pkg/mod/github.com/santhosh-tekuri/jsonschema/v5@v5.3.1/content.go conf�� go user.name git (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build3958490663/b275/launcher.test /tmp/go-build3958490663/b275/launcher.test -test.testlogfile=/tmp/go-build3958490663/b275/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -c=4 -nolocalimports -importcfg /tmp/go-build3958490663/b232/importcfg -pack /home/REDACTED/go/pkg/mod/github.com/santhosh-tekuri/jsonschema/v5@v5.3.1/compiler.go /home/REDACTED/go/pkg/mod/github.com/santhosh-tekuri/jsonschema/v5@v5.3.1/content.go conf�� go user.name git (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build3958490663/b284/mcp.test /tmp/go-build3958490663/b284/mcp.test -test.testlogfile=/tmp/go-build3958490663/b284/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true go H6RJmYT_A /usr/bin/git =fetch (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix the failing GitHub Actions workflow lint
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 64402534822
Job URL: https://github.com/github/gh-aw-mcpg/actions/runs/22262314337/job/64402534822


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…apture

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow lint Remove unused fields from handlerCapture test struct Feb 21, 2026
@lpcox
lpcox marked this pull request as ready for review February 21, 2026 18:57
Copilot AI review requested due to automatic review settings February 21, 2026 18:57
@lpcox
lpcox merged commit 1b8f64f into copilot/add-serena-tools-for-language-support Feb 21, 2026
@lpcox
lpcox deleted the copilot/fix-github-actions-lint-another-one branch February 21, 2026 18:57

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 removes two unused fields from the handlerCapture test helper struct in internal/server/sdk_logging_test.go. The golangci-lint unused linter identified that statusCode and responseBody fields were defined but never read or written. While these values are passed as parameters to makeInnerHandler, they were never stored back onto the struct. Tests verify response status and body through the httptest.ResponseRecorder instead.

Changes:

  • Removed unused statusCode and responseBody fields from the handlerCapture test struct

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

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.

3 participants