Skip to content

Commit 246b446

Browse files
committed
Update golangci-lint to v2
1 parent 2135271 commit 246b446

File tree

5 files changed

+56
-36
lines changed

5 files changed

+56
-36
lines changed

.github/workflows/lint.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,17 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2424
with:
2525
fetch-depth: 0
2626
- name: Setup Go
27-
uses: actions/setup-go@v4
27+
uses: actions/setup-go@v5
2828
with:
29-
go-version: ^1.24
30-
- name: Cache go module
31-
uses: actions/cache@v3
32-
with:
33-
path: |
34-
~/go/pkg/mod
35-
key: go-${{ hashFiles('**/go.sum') }}
29+
go-version: ~1.24.6
3630
- name: golangci-lint
37-
uses: golangci/golangci-lint-action@v3
31+
uses: golangci/golangci-lint-action@v8
3832
with:
39-
version: latest
33+
version: latest
34+
args: --timeout=30m
35+
install-mode: binary
36+
verify: false

.golangci.yml

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,49 @@
1+
version: "2"
2+
run:
3+
go: "1.24"
14
linters:
2-
disable-all: true
5+
default: none
36
enable:
4-
- gofumpt
57
- govet
6-
- gci
7-
- staticcheck
8-
- paralleltest
98
- ineffassign
10-
11-
linters-settings:
12-
gci:
13-
custom-order: true
14-
sections:
15-
- standard
16-
- prefix(github.com/sagernet/)
17-
- default
18-
staticcheck:
19-
checks:
20-
- all
21-
- -SA1003
22-
23-
run:
24-
go: "1.23"
9+
- paralleltest
10+
- staticcheck
11+
settings:
12+
staticcheck:
13+
checks:
14+
- all
15+
- -S1000
16+
- -S1008
17+
- -S1017
18+
- -ST1003
19+
- -QF1001
20+
- -QF1003
21+
- -QF1008
22+
exclusions:
23+
generated: lax
24+
presets:
25+
- comments
26+
- common-false-positives
27+
- legacy
28+
- std-error-handling
29+
paths:
30+
- third_party$
31+
- builtin$
32+
- examples$
33+
formatters:
34+
enable:
35+
- gci
36+
- gofumpt
37+
settings:
38+
gci:
39+
sections:
40+
- standard
41+
- prefix(github.com/sagernet/)
42+
- default
43+
custom-order: true
44+
exclusions:
45+
generated: lax
46+
paths:
47+
- third_party$
48+
- builtin$
49+
- examples$

congestion_meta2/packet_number_indexed_queue.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ func (p *packetNumberIndexedQueue[T]) RemoveUpTo(packetNumber congestion.PacketN
132132
p.firstPacket++
133133
}
134134
p.clearup()
135-
136-
return
137135
}
138136

139137
// IsEmpty return if queue is empty.

congestion_meta2/windowed_filter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func MinFilter[O constraints.Ordered](a, b O) int {
7575
func NewWindowedFilter[V WindowedFilterValue, T WindowedFilterTime](windowLength T, comparator func(V, V) int) *WindowedFilter[V, T] {
7676
return &WindowedFilter[V, T]{
7777
windowLength: windowLength,
78-
estimates: make([]entry[V, T], 3, 3),
78+
estimates: make([]entry[V, T], 3),
7979
comparator: comparator,
8080
}
8181
}
@@ -158,5 +158,5 @@ func (f *WindowedFilter[V, T]) Reset(newSample V, newTime T) {
158158
}
159159

160160
func (f *WindowedFilter[V, T]) Clear() {
161-
f.estimates = make([]entry[V, T], 3, 3)
161+
f.estimates = make([]entry[V, T], 3)
162162
}

tuic/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ type Client struct {
4646
zeroRTTHandshake bool
4747
heartbeat time.Duration
4848

49-
connAccess sync.RWMutex
49+
connAccess sync.Mutex
5050
conn *clientQUICConnection
5151
}
5252

0 commit comments

Comments
 (0)