Skip to content

Commit 092344f

Browse files
fix(lint): add return after t.Fatal to satisfy staticcheck SA5011
The staticcheck linter doesn't recognize that t.Fatal stops test execution, so it warns about potential nil pointer dereference on subsequent lines. Adding explicit return statements after t.Fatal makes the control flow clear to the linter. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent da4ca40 commit 092344f

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

internal/cli/output/help_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ func TestExtractHelpInfo_Flags(t *testing.T) {
174174

175175
if outputFlag == nil {
176176
t.Fatal("Expected to find 'output' flag")
177+
return // unreachable but satisfies staticcheck SA5011
177178
}
178179

179180
if outputFlag.Shorthand != "o" {

internal/config/merge_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func TestMergeServerConfig_ScalarFieldReplacement(t *testing.T) {
4747
// Verify diff captured changes
4848
if diff == nil {
4949
t.Fatal("Expected diff to be generated")
50+
return // unreachable but satisfies staticcheck SA5011
5051
}
5152
if _, ok := diff.Modified["url"]; !ok {
5253
t.Error("URL change not captured in diff")
@@ -322,6 +323,7 @@ func TestMergeServerConfig_ExplicitNullRemovesField(t *testing.T) {
322323
// Verify diff captures removal
323324
if diff == nil {
324325
t.Fatal("Expected diff to be generated")
326+
return // unreachable but satisfies staticcheck SA5011
325327
}
326328
found := false
327329
for _, field := range diff.Removed {

0 commit comments

Comments
 (0)