File tree Expand file tree Collapse file tree 6 files changed +92
-55
lines changed Expand file tree Collapse file tree 6 files changed +92
-55
lines changed Original file line number Diff line number Diff line change 12
12
strategy :
13
13
matrix :
14
14
go-version :
15
- - " 1.21"
16
- - " 1.22"
17
15
- " 1.23"
18
16
- " 1.24"
19
17
name : lint and test
26
24
with :
27
25
go-version : ${{ matrix.go-version }}
28
26
- name : golangci-lint
29
- uses : golangci/golangci-lint-action@v6.5 .0
27
+ uses : golangci/golangci-lint-action@v7.0 .0
30
28
with :
31
- version : v1.64 .5
29
+ version : v2.1 .5
32
30
- name : test
33
31
run : make test_ci
Original file line number Diff line number Diff line change
1
+ run :
2
+ timeout : 5m
3
+ issues-exit-code : 1
4
+ tests : true
5
+
6
+ issues :
7
+ max-same-issues : 100
8
+ include :
9
+ - EXC0012
10
+ - EXC0014
11
+ exclude-dirs :
12
+ - local
13
+ exclude-rules :
14
+ - path : example_test.go
15
+ linters :
16
+ - revive
17
+ text : " seems to be unused"
18
+ fix : true
19
+
20
+ linters :
21
+ enable :
22
+ - bodyclose
23
+ - copyloopvar
24
+ - gofumpt
25
+ - goimports
26
+ - gosimple
27
+ - govet
28
+ - ineffassign
29
+ - misspell
30
+ - revive
31
+ - staticcheck
32
+ - typecheck
33
+ - unused
34
+ - whitespace
35
+
36
+ output :
37
+ formats :
38
+ - format : colored-line-number
39
+ print-issued-lines : true
40
+ print-linter-name : true
41
+ path-prefix : " "
42
+ sort-results : true
Original file line number Diff line number Diff line change
1
+ version : " 2"
1
2
run :
2
- timeout : 5m
3
3
issues-exit-code : 1
4
4
tests : true
5
-
6
- issues :
7
- max-same-issues : 100
8
- include :
9
- - EXC0012
10
- - EXC0014
11
- exclude-dirs :
12
- - local
13
- exclude-rules :
14
- - path : example_test.go
15
- linters :
16
- - revive
17
- text : " seems to be unused"
18
- fix : true
19
-
5
+ output :
6
+ formats :
7
+ text :
8
+ path : stdout
9
+ print-linter-name : true
10
+ print-issued-lines : true
11
+ path-prefix : " "
20
12
linters :
21
13
enable :
22
14
- bodyclose
23
15
- copyloopvar
24
- - gofumpt
25
- - goimports
26
- - gosimple
27
- - govet
28
- - ineffassign
29
16
- misspell
30
17
- revive
31
- - staticcheck
32
- - typecheck
33
- - unused
34
18
- whitespace
35
-
36
- output :
37
- formats :
38
- - format : colored-line-number
39
- print-issued-lines : true
40
- print-linter-name : true
41
- path-prefix : " "
42
- sort-results : true
19
+ exclusions :
20
+ generated : lax
21
+ presets :
22
+ - common-false-positives
23
+ - legacy
24
+ - std-error-handling
25
+ rules :
26
+ - linters :
27
+ - revive
28
+ path : example_test.go
29
+ text : seems to be unused
30
+ - linters :
31
+ - revive
32
+ text : package-comments
33
+ paths :
34
+ - local
35
+ - third_party$
36
+ - builtin$
37
+ - examples$
38
+ issues :
39
+ max-same-issues : 100
40
+ fix : true
41
+ formatters :
42
+ enable :
43
+ - gofumpt
44
+ - goimports
45
+ exclusions :
46
+ generated : lax
47
+ paths :
48
+ - local
49
+ - third_party$
50
+ - builtin$
51
+ - examples$
Original file line number Diff line number Diff line change 2
2
# See https://pre-commit.com/hooks.html for more hooks
3
3
repos :
4
4
- repo : https://github.com/pre-commit/pre-commit-hooks
5
- rev : v4.5 .0
5
+ rev : v5.0 .0
6
6
hooks :
7
7
- id : check-added-large-files
8
8
- id : check-case-conflict
12
12
- id : end-of-file-fixer
13
13
- id : trailing-whitespace
14
14
- repo : https://github.com/golangci/golangci-lint
15
- rev : v1.64 .5
15
+ rev : v2.1 .5
16
16
hooks :
17
17
- id : golangci-lint
18
18
- repo : https://github.com/TekWizely/pre-commit-golang
Original file line number Diff line number Diff line change 1
1
module github.com/go-co-op/gocron/v2
2
2
3
- go 1.21 .0
3
+ go 1.23 .0
4
4
5
5
require (
6
6
github.com/google/uuid v1.6.0
Original file line number Diff line number Diff line change @@ -1626,10 +1626,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
1626
1626
func (t * testing.T ) {
1627
1627
timeout := time .Now ().Add (1 * time .Second )
1628
1628
var notLeaderCount int
1629
- for {
1630
- if time .Now ().After (timeout ) {
1631
- break
1632
- }
1629
+ for ! time .Now ().After (timeout ) {
1633
1630
select {
1634
1631
case <- notLeader :
1635
1632
notLeaderCount ++
@@ -1650,10 +1647,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
1650
1647
func (_ * testing.T ) {
1651
1648
timeout := time .Now ().Add (1 * time .Second )
1652
1649
var notLockedCount int
1653
- for {
1654
- if time .Now ().After (timeout ) {
1655
- break
1656
- }
1650
+ for ! time .Now ().After (timeout ) {
1657
1651
select {
1658
1652
case <- notLocked :
1659
1653
notLockedCount ++
@@ -1675,10 +1669,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
1675
1669
func (_ * testing.T ) {
1676
1670
timeout := time .Now ().Add (1 * time .Second )
1677
1671
var notLockedCount int
1678
- for {
1679
- if time .Now ().After (timeout ) {
1680
- break
1681
- }
1672
+ for ! time .Now ().After (timeout ) {
1682
1673
select {
1683
1674
case <- notLocked :
1684
1675
notLockedCount ++
@@ -1702,10 +1693,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
1702
1693
func (_ * testing.T ) {
1703
1694
timeout := time .Now ().Add (1 * time .Second )
1704
1695
var notLockedCount int
1705
- for {
1706
- if time .Now ().After (timeout ) {
1707
- break
1708
- }
1696
+ for ! time .Now ().After (timeout ) {
1709
1697
select {
1710
1698
case <- notLocked :
1711
1699
notLockedCount ++
You can’t perform that action at this time.
0 commit comments