Skip to content

Remove unused fields from handlerCapture test struct#1244

Merged
lpcox merged 2 commits intocopilot/update-tool-logging-formatfrom
copilot/fix-github-actions-lint-another-one
Feb 21, 2026
Merged

Remove unused fields from handlerCapture test struct#1244
lpcox merged 2 commits intocopilot/update-tool-logging-formatfrom
copilot/fix-github-actions-lint-another-one

Conversation

Copy link
Contributor

Copilot AI commented Feb 21, 2026

golangci-lint was failing with unused errors on two fields in the handlerCapture struct in internal/server/sdk_logging_test.go.

Change

Removed statusCode and responseBody from handlerCapture — both values are passed as parameters to makeInnerHandler and written directly to http.ResponseWriter, never stored back into the struct.

// Before
type handlerCapture struct {
    called       bool
    body         []byte
    statusCode   int    // unused
    responseBody []byte // unused
}

// 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-build2191527050/b279/launcher.test /tmp/go-build2191527050/b279/launcher.test -test.testlogfile=/tmp/go-build2191527050/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo 64/src/regexp/syntax/compile.go x_amd64/compile user.email 7973+lpcox@users-unsafeptr=false (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build2191527050/b264/config.test /tmp/go-build2191527050/b264/config.test -test.testlogfile=/tmp/go-build2191527050/b264/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo ed struct fields in sdk_logging_--64 .12/x64/as pull.rebase (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build2191527050/b279/launcher.test /tmp/go-build2191527050/b279/launcher.test -test.testlogfile=/tmp/go-build2191527050/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo 64/src/regexp/syntax/compile.go x_amd64/compile user.email 7973+lpcox@users-unsafeptr=false (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build2191527050/b279/launcher.test /tmp/go-build2191527050/b279/launcher.test -test.testlogfile=/tmp/go-build2191527050/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/runtime/cgo 64/src/regexp/syntax/compile.go x_amd64/compile user.email 7973+lpcox@users-unsafeptr=false (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build2191527050/b288/mcp.test /tmp/go-build2191527050/b288/mcp.test -test.testlogfile=/tmp/go-build2191527050/b288/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true ache/go/1.25.6/x64/src/runtime/cgo1.25.6 z7W-/HuzXJ-P4m3m2aPTQz7W- x_amd64/vet (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: 64402777100
Job URL: https://github.com/github/gh-aw-mcpg/actions/runs/22262448694/job/64402777100


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

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
@lpcox lpcox marked this pull request as ready for review February 21, 2026 19:02
Copilot AI review requested due to automatic review settings February 21, 2026 19:02
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow lint Remove unused fields from handlerCapture test struct Feb 21, 2026
@lpcox lpcox merged commit c90b230 into copilot/update-tool-logging-format Feb 21, 2026
@lpcox lpcox deleted the copilot/fix-github-actions-lint-another-one branch February 21, 2026 19:02
Copy link
Contributor

Copilot AI left a comment

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 fixes a linter failure in the GitHub Actions workflow by removing unused struct fields from the test helper handlerCapture in internal/server/sdk_logging_test.go. The CI linter correctly identified that the statusCode and responseBody fields were declared but never accessed anywhere in the test code.

Changes:

  • Removed unused statusCode and responseBody fields from the handlerCapture struct, which tracks what an inner HTTP handler receives during tests

💡 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