From ea167af2c28a13825f1cbfa635e2e12d87d4748f Mon Sep 17 00:00:00 2001 From: Grey Newell Date: Tue, 21 Apr 2026 16:27:03 -0400 Subject: [PATCH] fix(mcp): add return after t.Fatal to satisfy staticcheck SA5011 staticcheck SA5011 flags pointer dereferences that follow a nil check guarded only by t.Fatal, which it does not recognise as goroutine-terminating. Adding an unreachable return satisfies the analyser without changing test behaviour. Co-Authored-By: Claude Sonnet 4.6 --- internal/mcp/server_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/mcp/server_test.go b/internal/mcp/server_test.go index 91926b1..4f52333 100644 --- a/internal/mcp/server_test.go +++ b/internal/mcp/server_test.go @@ -312,6 +312,7 @@ func TestDispatch_UnknownMethod(t *testing.T) { _, rpcErr := s.dispatch(context.Background(), "unknown/method", nil) if rpcErr == nil { t.Fatal("expected rpcError for unknown method") + return } if rpcErr.Code != codeMethodNotFound { t.Errorf("expected codeMethodNotFound (%d), got %d", codeMethodNotFound, rpcErr.Code) @@ -325,6 +326,7 @@ func TestDispatch_ToolsCall_UnknownTool(t *testing.T) { _, rpcErr := s.dispatch(context.Background(), "tools/call", params) if rpcErr == nil { t.Fatal("expected rpcError for unknown tool name in tools/call") + return } if rpcErr.Code != codeInternalError { t.Errorf("expected codeInternalError (%d), got %d", codeInternalError, rpcErr.Code) @@ -566,6 +568,7 @@ func TestHandleToolCall_ParseError(t *testing.T) { _, rpcErr := s.handleToolCall(context.Background(), badParams) if rpcErr == nil { t.Fatal("expected rpcError for invalid params JSON") + return } if rpcErr.Code != codeParseError { t.Errorf("expected codeParseError (%d), got %d", codeParseError, rpcErr.Code)