Skip to content

all: modernize code#868

Merged
maciej-kisiel merged 2 commits intomodelcontextprotocol:mainfrom
alexandear-org:all-modernize-code
Mar 31, 2026
Merged

all: modernize code#868
maciej-kisiel merged 2 commits intomodelcontextprotocol:mainfrom
alexandear-org:all-modernize-code

Conversation

@alexandear
Copy link
Copy Markdown
Contributor

Use go fix ./... to modernize the code.

Copilot AI review requested due to automatic review settings March 30, 2026 16:30
Copy link
Copy Markdown

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

Modernizes the Go SDK codebase by applying go fix ./..., aligning tests/examples with newer Go language/library features.

Changes:

  • Replaced interface{} with any in maps and test struct fields.
  • Updated goroutine + WaitGroup patterns to use wg.Go(...).
  • Switched some test/bench contexts to t.Context() / b.Context() and modernized simple loops (e.g., for range 3).

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
oauthex/token_exchange_test.go Uses map[string]any in test response payload.
mcp/streamable_test.go Modernizes WaitGroup goroutine spawning and uses t.Context() in a test.
mcp/streamable_bench_test.go Uses b.Context() and removes now-unneeded context import.
mcp/schema_cache_test.go Replaces counted loop with for range 3.
mcp/mcp_test.go Replaces manual WaitGroup goroutine pattern with wg.Go.
mcp/content_nil_test.go Updates test struct fields from interface{} to any.
mcp/cmd_test.go Uses t.Context() instead of context.WithCancel(...) in tests.
internal/oauthtest/fake_authorization_server.go Uses map[string]any for JSON encoding.
examples/server/distributed/main.go Uses wg.Go(...) for child/server goroutines.
examples/client/loadtest/main.go Uses wg.Go(...) for worker goroutines.
docs/protocol.md Removes trailing whitespace/blank line at EOF.
auth/extauth/oidc_login_test.go Uses map[string]any and updates helper signature accordingly.
auth/extauth/enterprise_handler_test.go Uses map[string]any for WithExtra(...) and JSON encoding.

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

@maciej-kisiel
Copy link
Copy Markdown
Contributor

Please revert protocol.md change to make the check pass.

@alexandear
Copy link
Copy Markdown
Contributor Author

@maciej-kisiel fixed, thank you

@maciej-kisiel
Copy link
Copy Markdown
Contributor

Could you also merge with main?

@alexandear
Copy link
Copy Markdown
Contributor Author

@maciej-kisiel done

@maciej-kisiel maciej-kisiel merged commit a1f808c into modelcontextprotocol:main Mar 31, 2026
9 checks passed
@alexandear alexandear deleted the all-modernize-code branch March 31, 2026 09:00
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