fix(mcp): add return after t.Fatal to satisfy staticcheck SA5011#141
fix(mcp): add return after t.Fatal to satisfy staticcheck SA5011#141greynewell merged 1 commit intomainfrom
Conversation
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 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThree test cases in the server test file now include early return statements after asserting that an Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Here's the vibe: Think of this like a safety checkpoint. Imagine you're checking if a package arrived ( 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
returnafter eacht.Fatalcall in threeserver_test.gotests where staticcheck SA5011 was flagging a potential nil pointer dereferencet.Fatalas goroutine-terminating, so it considers a pointer that was checked for nil and then dereferenced in the next block as potentially nil — thereturnsatisfies the analyser without changing behaviourAffected tests:
TestDispatch_UnknownMethodTestDispatch_ToolsCall_UnknownToolTestHandleToolCall_ParseErrorTest plan
make lint— 0 issuesgo test ./internal/mcp/...— all tests pass🤖 Generated with Claude Code
Summary by CodeRabbit