From 981f7cb41fe42b57d90eb0a36f2909f801bf2f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20St=C3=A4bler?= Date: Tue, 14 Apr 2026 17:59:05 +0200 Subject: [PATCH] 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. --- api/v1alpha1/function_lifecycle_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/v1alpha1/function_lifecycle_test.go b/api/v1alpha1/function_lifecycle_test.go index 30bdd68..404a2e3 100644 --- a/api/v1alpha1/function_lifecycle_test.go +++ b/api/v1alpha1/function_lifecycle_test.go @@ -95,6 +95,7 @@ func TestCalculateReadyCondition(t *testing.T) { readyCondition := meta.FindStatusCondition(f.Status.Conditions, TypeReady) if readyCondition == nil { t.Fatal("Ready condition not found") + return } if readyCondition.Status != tt.expectedStatus { @@ -149,6 +150,7 @@ func TestInitializeConditions(t *testing.T) { readyCond := meta.FindStatusCondition(f.Status.Conditions, TypeReady) if readyCond == nil { t.Fatal("Ready condition not found") + return } if readyCond.Status != metav1.ConditionUnknown { t.Errorf("Ready condition: expected status Unknown, got %v", readyCond.Status)