Skip to content

Commit 6318b67

Browse files
authored
build(deps): add exptostd, govet, thelper, tparallel, usestdlibvars, and usetesting linters (#1410)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent fc61ef8 commit 6318b67

7 files changed

Lines changed: 14 additions & 4 deletions

File tree

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ linters:
1818
- bodyclose
1919
- contextcheck
2020
- errorlint
21+
- exptostd
2122
- gocritic
2223
- godot
2324
- gosec
25+
- govet
2426
- misspell
2527
- modernize
2628
- noctx
@@ -29,8 +31,12 @@ linters:
2931
- revive
3032
- staticcheck
3133
- testifylint
34+
- thelper
35+
- tparallel
3236
- unconvert
3337
- unparam
38+
- usestdlibvars
39+
- usetesting
3440
- whitespace
3541
exclusions:
3642
generated: lax

pkg/cache/v3/simple_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ func TestSnapshotCacheWatch(t *testing.T) {
326326
}
327327

328328
func TestConcurrentSetWatch(t *testing.T) {
329+
t.Parallel()
329330
c := cache.NewSnapshotCache(false, group{}, log.NewTestLogger(t))
330331
for i := range 50 {
331332
t.Run(fmt.Sprintf("worker%d", i), func(t *testing.T) {

pkg/log/test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ type testLogger struct {
88

99
var _ Logger = testLogger{}
1010

11-
func NewTestLogger(t testing.TB) Logger {
12-
return testLogger{t}
11+
func NewTestLogger(tb testing.TB) Logger {
12+
tb.Helper()
13+
return testLogger{tb}
1314
}
1415

1516
// Debugf logs a message at level debug on the test logger.

pkg/server/v3/delta_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func (stream *mockDeltaStream) Recv() (*discovery.DeltaDiscoveryRequest, error)
149149
}
150150

151151
func makeMockDeltaStream(t *testing.T) *mockDeltaStream {
152+
t.Helper()
152153
ctx, cancel := context.WithCancel(context.Background())
153154
return &mockDeltaStream{
154155
t: t,

pkg/server/v3/server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func (stream *mockStream) Recv() (*discovery.DiscoveryRequest, error) {
135135
}
136136

137137
func makeMockStream(t *testing.T) *mockStream {
138+
t.Helper()
138139
return &mockStream{
139140
t: t,
140141
ctx: context.Background(),

pkg/test/main/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func callEcho() (int, int) {
339339
if err != nil {
340340
return nil, err
341341
}
342-
return client.Do(req)
342+
return client.Do(req) //nolint:gosec
343343
}
344344

345345
// spawn requests

pkg/test/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (h *HTTPGateway) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
129129
return
130130
}
131131

132-
if _, err = resp.Write(bytes); err != nil && h.Log != nil {
132+
if _, err = resp.Write(bytes); err != nil && h.Log != nil { //nolint:gosec
133133
h.Log.Errorf("gateway error: %v", err)
134134
}
135135
}

0 commit comments

Comments
 (0)