style(mcp): apply go fix to the sampling transport

This commit is contained in:
sam committed 2026-10-02 09:35:21 +10:00
1 parent c3faf30b12
commit 2aef002988
2 files changed
+4 -8

No files matched your search

+2 -4
View File
@@ -540,9 +540,7 @@ func (t *StdioTransport) dispatchServerRequest(ctx context.Context, msg Message)
handler := t.serverRequestHandler
t.mu.Unlock()
t.serverRequestWg.Add(1)
go func() {
defer t.serverRequestWg.Done()
t.serverRequestWg.Go(func() {
var (
result json.RawMessage
rpcErr *ErrorData
@@ -553,7 +551,7 @@ func (t *StdioTransport) dispatchServerRequest(ctx context.Context, msg Message)
result, rpcErr = handler(ctx, msg.Method, msg.Params)
}
t.respondToServerRequest(msg.ID, result, rpcErr)
}()
})
}
// respondToServerRequest writes a JSON-RPC response for a server-initiated
+2 -4
View File
@@ -441,9 +441,7 @@ func (t *SSETransport) dispatchServerRequest(ctx context.Context, msg Message) {
handler := t.serverRequestHandler
t.mu.Unlock()
t.serverRequestWg.Add(1)
go func() {
defer t.serverRequestWg.Done()
t.serverRequestWg.Go(func() {
var (
result json.RawMessage
rpcErr *ErrorData
@@ -461,7 +459,7 @@ func (t *SSETransport) dispatchServerRequest(ctx context.Context, msg Message) {
// and a failed POST is a connection the reader is already
// reconnecting.
_ = t.postJSON(ctx, body)
}()
})
}
// ── POST ─────────────────────────────────────────────────────────────────