Skip to content

Commit 782498a

Browse files
committed
test: finish staticcheck nil guard cleanup
1 parent d8435c7 commit 782498a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

internal/watch/detector_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ func TestDetectRestart_RestartCountDecrease(t *testing.T) {
109109
// Should still detect via StartedAt change
110110
if ev == nil {
111111
t.Fatal("expected restart event from StartedAt change when count decreased")
112-
}
113-
if ev.RestartCount != 0 {
112+
} else if ev.RestartCount != 0 {
114113
t.Errorf("expected RestartCount=0, got %d", ev.RestartCount)
115114
}
116115
}
@@ -139,8 +138,7 @@ func TestDetectRestart_RestartCountIncrease_SameStartedAt(t *testing.T) {
139138
ev := DetectRestart(prev, curr)
140139
if ev == nil {
141140
t.Fatal("expected event from RestartCount increase")
142-
}
143-
if ev.Container != "app" {
141+
} else if ev.Container != "app" {
144142
t.Errorf("expected app, got %s", ev.Container)
145143
}
146144
}

0 commit comments

Comments
 (0)