Skip to content

Commit cc21b2c

Browse files
committedJul 11, 2021
Add linting and fix a linter warning and a flaky test
1 parent 058073f commit cc21b2c

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed
 

‎.golangci.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
run:
2+
timeout: 30s
3+
4+
issues:
5+
max-issues-per-linter: 0
6+
max-same-issues: 0
7+
8+
linters-settings:
9+
gocritic:
10+
enabled-tags:
11+
- diagnostic
12+
- experimental
13+
- opinionated
14+
- performance
15+
- style
16+
17+
linters:
18+
disable-all: true
19+
enable:
20+
# Default linters reported by golangci-lint help linters` in v1.39.0
21+
- deadcode
22+
- errcheck
23+
- gosimple
24+
- govet
25+
- gosimple
26+
- ineffassign
27+
- staticcheck
28+
- structcheck
29+
- stylecheck
30+
- typecheck
31+
- unused
32+
- varcheck
33+
# Extra linters:
34+
- gofmt
35+
- goimports
36+
- gocritic
37+
- revive
38+
- bodyclose
39+
- gosec

‎tunny_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func TestTimedJobsAfterClose(t *testing.T) {
187187
})
188188
pool.Close()
189189

190-
_, act := pool.ProcessTimed(10, time.Duration(1))
190+
_, act := pool.ProcessTimed(10, time.Duration(10*time.Millisecond))
191191
if exp := ErrPoolNotRunning; exp != act {
192192
t.Errorf("Wrong error returned: %v != %v", act, exp)
193193
}

‎worker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (w *workerWrapper) run() {
104104
case <-w.interruptChan:
105105
w.interruptChan = make(chan struct{})
106106
}
107-
case _, _ = <-w.interruptChan:
107+
case <-w.interruptChan:
108108
w.interruptChan = make(chan struct{})
109109
}
110110
case <-w.closeChan:

0 commit comments

Comments
 (0)
Please sign in to comment.