Commit abf04a8
authored
Fix golangci-lint CI failures in internal/proxy/handler.go (#2189)
Two staticcheck violations introduced in `internal/proxy/handler.go`
were causing the lint CI job to fail.
## Changes
- **Remove `forwardGraphQL`**: Dead code — defined but never called.
GraphQL forwarding is handled inline in `handleWithDIFC`.
- **Fix S1034 type switch**: Eliminate redundant type assertion inside
the `map[string]interface{}` case by using the idiomatic assigned type
switch form:
```go
// Before
switch originalData.(type) {
case map[string]interface{}:
obj := originalData.(map[string]interface{}) // redundant assertion
...
}
// After
switch obj := originalData.(type) {
case map[string]interface{}:
// obj is already the asserted type
...
}
```
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `example.com`
> - Triggering command: `/tmp/go-build1696049945/b333/launcher.test
/tmp/go-build1696049945/b333/launcher.test
-test.testlogfile=/tmp/go-build1696049945/b333/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build1696049945/b238/vet.cfg go o x_amd64/compile` (dns block)
> - `invalid-host-that-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build1696049945/b318/config.test
/tmp/go-build1696049945/b318/config.test
-test.testlogfile=/tmp/go-build1696049945/b318/testlog.txt
-test.paniconexit0 -test.timeout=10m0s ncod�� 64/src/runtime/cgo
64/src/encoding/asn1/asn1.go x_amd64/asm` (dns block)
> - `nonexistent.local`
> - Triggering command: `/tmp/go-build1696049945/b333/launcher.test
/tmp/go-build1696049945/b333/launcher.test
-test.testlogfile=/tmp/go-build1696049945/b333/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build1696049945/b238/vet.cfg go o x_amd64/compile` (dns block)
> - `slow.example.com`
> - Triggering command: `/tmp/go-build1696049945/b333/launcher.test
/tmp/go-build1696049945/b333/launcher.test
-test.testlogfile=/tmp/go-build1696049945/b333/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build1696049945/b238/vet.cfg go o x_amd64/compile` (dns block)
> - `this-host-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build1696049945/b342/mcp.test
/tmp/go-build1696049945/b342/mcp.test
-test.testlogfile=/tmp/go-build1696049945/b342/testlog.txt
-test.paniconexit0 -test.timeout=10m0s
/tmp/go-build1696049945/b215/vet.cfg p/go-build linux.go x_amd64/compile
--exclude-hidden/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
terpreter --quiet x_amd64/compile 2599�� ache/go/1.25.8/x-errorsas
AcPk/Gl1SDLLxjjl-ifaceassert x_amd64/vet` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent)
(admins only)
>
> </details>
<!-- START COPILOT CODING AGENT SUFFIX -->
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
> Fix the failing GitHub Actions workflow lint
> Analyze the workflow logs, identify the root cause of the failure, and
implement a fix.
> Job ID: 67821217215
> Job URL:
https://github.com/github/gh-aw-mcpg/actions/runs/23317651473/job/67821217215
</details>
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.1 file changed
Lines changed: 1 addition & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | 294 | | |
313 | 295 | | |
314 | 296 | | |
| |||
326 | 308 | | |
327 | 309 | | |
328 | 310 | | |
329 | | - | |
| 311 | + | |
330 | 312 | | |
331 | 313 | | |
332 | 314 | | |
333 | | - | |
334 | 315 | | |
335 | 316 | | |
336 | 317 | | |
| |||
0 commit comments