[Repo Assist] refactor(mcp): replace interface{} with any - #10230
Conversation
The 'any' type alias for interface{} was introduced in Go 1.18 and is
the idiomatic modern form. This aligns the mcp package with Go style
conventions and matches the cleanup already done in internal/util.
No behaviour change; purely mechanical substitution.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Modernizes internal/mcp by replacing interface{} with its equivalent any alias.
Changes:
- Updates MCP request, transport, schema, and result types.
- Preserves runtime behavior and API compatibility.
- Requires
gofmtcleanup intypes.go.
Show a summary per file
| File | Description |
|---|---|
internal/mcp/types.go |
Modernizes JSON-RPC and tool types. |
internal/mcp/tool_result.go |
Modernizes result conversion types. |
internal/mcp/schema.go |
Modernizes schema map types. |
internal/mcp/http_transport.go |
Modernizes HTTP request parameter types. |
internal/mcp/helpers.go |
Modernizes generic helper signatures. |
internal/mcp/connection.go |
Modernizes request APIs and payload maps. |
internal/mcp/connection_transport.go |
Modernizes reconnect helper parameters. |
internal/mcp/connection_methods.go |
Modernizes SDK dispatch parameters. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Medium
| type Request struct { | ||
| JSONRPC string `json:"jsonrpc"` | ||
| ID interface{} `json:"id,omitempty"` | ||
| ID any `json:"id,omitempty"` |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot merge main, address review feedback and fix failing lint ci https://github.com/github/gh-aw-mcpg/actions/runs/30362930407/job/90308141120?pr=10230 |
…cp-any-alias-8727937f7ed2aaa2
…erface{} -> any replacement; merge main
Done. Merged main and ran |
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Note: Part B write tools are absent from the gateway-exposed tool set (MCP References: §30374904716
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30374905032
|
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Notes
References: §30374904441
|
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Continues the
interface{}→anymodernization started ininternal/util(#10177), now covering theinternal/mcppackage — the largest remaining concentration of the old form in non-test production code (67 occurrences across 8 files).The
anytype alias forinterface{}was introduced in Go 1.18 and is the idiomatic modern style recommended by the Go team. This is a purely mechanical, zero-behaviour-change substitution.Files changed
internal/mcp/tool_result.gointernal/mcp/http_transport.gointernal/mcp/helpers.gointernal/mcp/schema.gointernal/mcp/types.gointernal/mcp/connection.gointernal/mcp/connection_methods.gointernal/mcp/connection_transport.goTest Status
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
proxy.golang.orgSee Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run