Skip to content

Commit fa83453

Browse files
authored
explicit return from test after nil check (#1350)
Signed-off-by: Etai Lev Ran <[email protected]>
1 parent 928e051 commit fa83453

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/epp/saturationdetector/saturationdetector_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func TestNewDetector(t *testing.T) {
114114
detector := NewDetector(LoadConfigFromEnv(), test.datastore, logr.Discard())
115115
if detector == nil {
116116
t.Fatalf("NewDetector() returned nil detector for valid config")
117+
return // explicit return so staticcheck does not warn on potential nil detector below.
117118
}
118119
if detector.config.QueueDepthThreshold != test.expectedQueueDepthThreshold {
119120
t.Errorf("NewDetector() QueueDepthThreshold = %d, want %d", detector.config.QueueDepthThreshold, test.expectedQueueDepthThreshold)

0 commit comments

Comments
 (0)