Skip to content

Commit 246ff2c

Browse files
fix(lint): add more return statements after t.Fatal for SA5011
Continue fixing staticcheck SA5011 warnings about potential nil pointer dereference by adding return statements after t.Fatal calls. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 092344f commit 246ff2c

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

internal/config/merge_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ func TestMergeServerConfig_ConfigDiffCapture(t *testing.T) {
404404

405405
if diff == nil {
406406
t.Fatal("Expected diff to be generated")
407+
return // unreachable but satisfies staticcheck SA5011
407408
}
408409

409410
// Check modified fields
@@ -727,6 +728,7 @@ func TestMergeServerConfig_ComplexNestedMerge(t *testing.T) {
727728
// Verify diff captured expected changes
728729
if diff == nil {
729730
t.Fatal("Expected diff to be generated")
731+
return // unreachable but satisfies staticcheck SA5011
730732
}
731733
if len(diff.Modified) < 5 {
732734
t.Errorf("Expected at least 5 modified fields, got %d", len(diff.Modified))

internal/updatecheck/checker_test.go

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

2929
if info == nil {
3030
t.Fatal("CheckNow returned nil")
31+
return // unreachable but satisfies staticcheck SA5011
3132
}
3233

3334
if info.CurrentVersion != "v1.0.0" {

0 commit comments

Comments
 (0)