Skip to content

Commit 7db9d1f

Browse files
mxpvthaJeztah
authored andcommitted
Fix linter warnings
Signed-off-by: Maksym Pavlenko <[email protected]> (cherry picked from commit 3a3f43f) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 4dc932e commit 7db9d1f

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

pkg/cri/store/container/status_test.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ func TestStatus(t *testing.T) {
132132

133133
t.Logf("failed update should not take effect")
134134
err = s.Update(func(o Status) (Status, error) {
135-
o = updateStatus
136-
return o, updateErr
135+
return updateStatus, updateErr
137136
})
138137
assert.Equal(updateErr, err)
139138
assert.Equal(testStatus, s.Get())
@@ -143,8 +142,7 @@ func TestStatus(t *testing.T) {
143142

144143
t.Logf("successful update should take effect but not checkpoint")
145144
err = s.Update(func(o Status) (Status, error) {
146-
o = updateStatus
147-
return o, nil
145+
return updateStatus, nil
148146
})
149147
assert.NoError(err)
150148
assert.Equal(updateStatus, s.Get())
@@ -153,14 +151,12 @@ func TestStatus(t *testing.T) {
153151
assert.Equal(testStatus, loaded)
154152
// Recover status.
155153
assert.NoError(s.Update(func(o Status) (Status, error) {
156-
o = testStatus
157-
return o, nil
154+
return testStatus, nil
158155
}))
159156

160157
t.Logf("failed update sync should not take effect")
161158
err = s.UpdateSync(func(o Status) (Status, error) {
162-
o = updateStatus
163-
return o, updateErr
159+
return updateStatus, updateErr
164160
})
165161
assert.Equal(updateErr, err)
166162
assert.Equal(testStatus, s.Get())
@@ -170,8 +166,7 @@ func TestStatus(t *testing.T) {
170166

171167
t.Logf("successful update sync should take effect and checkpoint")
172168
err = s.UpdateSync(func(o Status) (Status, error) {
173-
o = updateStatus
174-
return o, nil
169+
return updateStatus, nil
175170
})
176171
assert.NoError(err)
177172
assert.Equal(updateStatus, s.Get())

pkg/cri/store/sandbox/status_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ func TestStatus(t *testing.T) {
4545

4646
t.Logf("failed update should not take effect")
4747
err := s.Update(func(o Status) (Status, error) {
48-
o = updateStatus
49-
return o, updateErr
48+
return updateStatus, updateErr
5049
})
5150
assert.Equal(updateErr, err)
5251
assert.Equal(testStatus, s.Get())
5352

5453
t.Logf("successful update should take effect but not checkpoint")
5554
err = s.Update(func(o Status) (Status, error) {
56-
o = updateStatus
57-
return o, nil
55+
return updateStatus, nil
5856
})
5957
assert.NoError(err)
6058
assert.Equal(updateStatus, s.Get())

0 commit comments

Comments
 (0)