Skip to content

Commit 0954f61

Browse files
committed
fix(6208): added nolint comments for tests
1 parent 220e7b9 commit 0954f61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/pkg/config/output_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func TestToESConfig(t *testing.T) {
202202
require.NoError(t, err)
203203

204204
// cmp.Diff can't handle function pointers.
205-
res.Transport.(*http.Transport).Proxy = nil
205+
res.Transport.(*http.Transport).Proxy = nil //nolint:errcheck // skipping error check in test
206206

207207
test.result.Header.Set("X-elastic-product-origin", "fleet")
208208
assert.True(t, cmp.Equal(test.result, res, copts...), "mismatch (-want +got)\n%s", cmp.Diff(test.result, res, copts...))
@@ -238,7 +238,7 @@ func TestToESConfig(t *testing.T) {
238238
},
239239
}
240240

241-
es.Transport.(*http.Transport).Proxy = nil
241+
es.Transport.(*http.Transport).Proxy = nil //nolint:errcheck // skipping error check in test
242242
assert.True(t, cmp.Equal(expect, es, copts...), "mismatch (-want +got)\n%s", cmp.Diff(expect, es, copts...))
243243
})
244244

@@ -270,7 +270,7 @@ func TestToESConfig(t *testing.T) {
270270
},
271271
}
272272

273-
es.Transport.(*http.Transport).Proxy = nil
273+
es.Transport.(*http.Transport).Proxy = nil //nolint:errcheck // skipping error check in test
274274
assert.True(t, cmp.Equal(expect, es, copts...), "mismatch (-want +got)\n%s", cmp.Diff(expect, es, copts...))
275275
})
276276

@@ -388,7 +388,7 @@ func Test_Elasticsearch_DiagRequests(t *testing.T) {
388388
w.WriteHeader(http.StatusOK)
389389
}))
390390
defer srv.Close()
391-
ctx, cancel := context.WithCancel(context.Background())
391+
ctx, cancel := context.WithCancel(context.Background()) //nolint:usetesting // using context.Background not t.Context
392392
defer cancel()
393393
es := &Elasticsearch{}
394394
es.InitDefaults()

0 commit comments

Comments
 (0)