Skip to content

Commit 981f7cb

Browse files
committed
Fix staticcheck SA5011 false positives in function_lifecycle_test.go
Add explicit return statements after t.Fatal() calls to make it clear to staticcheck that execution terminates, preventing false positive nil pointer dereference warnings. This resolves intermittent lint failures in the merge queue where staticcheck SA5011 would complain about potential nil dereferences even though t.Fatal() terminates execution.
1 parent 895f307 commit 981f7cb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

api/v1alpha1/function_lifecycle_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ func TestCalculateReadyCondition(t *testing.T) {
9595
readyCondition := meta.FindStatusCondition(f.Status.Conditions, TypeReady)
9696
if readyCondition == nil {
9797
t.Fatal("Ready condition not found")
98+
return
9899
}
99100

100101
if readyCondition.Status != tt.expectedStatus {
@@ -149,6 +150,7 @@ func TestInitializeConditions(t *testing.T) {
149150
readyCond := meta.FindStatusCondition(f.Status.Conditions, TypeReady)
150151
if readyCond == nil {
151152
t.Fatal("Ready condition not found")
153+
return
152154
}
153155
if readyCond.Status != metav1.ConditionUnknown {
154156
t.Errorf("Ready condition: expected status Unknown, got %v", readyCond.Status)

0 commit comments

Comments
 (0)