Skip to content

Commit ea379e6

Browse files
committed
Upgrade golangci-lint to v2
1 parent 36cb4d6 commit ea379e6

File tree

3 files changed

+68
-51
lines changed

3 files changed

+68
-51
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ jobs:
3333
go-version: "1.24"
3434
cache: false
3535
- name: Run lint
36-
uses: golangci/golangci-lint-action@v6
36+
uses: golangci/golangci-lint-action@v8
3737
with:
38-
version: v1.64
38+
version: v2.1

.golangci.yml

Lines changed: 65 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,76 @@
1-
linters-settings:
2-
gocyclo:
3-
min-complexity: 18
4-
gofmt:
5-
simplify: true
6-
misspell:
7-
locale: US
8-
govet:
9-
disable:
10-
- shadow
11-
enable-all: true
12-
testifylint:
13-
disable:
14-
- require-error
15-
- error-nil
16-
- formatter
17-
- encoded-compare
18-
revive:
19-
rules:
20-
- name: var-naming
21-
arguments:
22-
- [] # AllowList
23-
- ["DTO"] # DenyList
24-
- name: unused-parameter
25-
disabled: false
26-
1+
version: "2"
272
linters:
283
enable:
29-
- gofmt
30-
- revive
4+
- bodyclose
5+
- copyloopvar
316
- gocyclo
7+
- inamedparam
328
- misspell
9+
- revive
10+
- testifylint
11+
- whitespace
3312
- govet
3413
- unused
3514
- errcheck
36-
- copyloopvar
37-
- gosimple
38-
- ineffassign
3915
- staticcheck
40-
- testifylint
41-
- whitespace
42-
- bodyclose
43-
- inamedparam
44-
disable-all: false
45-
fast: false
46-
16+
settings:
17+
gocyclo:
18+
min-complexity: 18
19+
govet:
20+
disable:
21+
- shadow
22+
enable-all: true
23+
misspell:
24+
locale: US
25+
revive:
26+
rules:
27+
- name: var-naming
28+
disabled: false
29+
arguments:
30+
- [] # AllowList
31+
- ["DTO"] # DenyList
32+
- name: unused-parameter
33+
disabled: false
34+
testifylint:
35+
disable:
36+
- require-error
37+
- error-nil
38+
- formatter
39+
- encoded-compare
40+
staticcheck:
41+
checks:
42+
[
43+
"all",
44+
"-ST1000",
45+
"-ST1003",
46+
"-ST1016",
47+
"-ST1020",
48+
"-ST1021",
49+
"-ST1022",
50+
"-QF1001",
51+
]
52+
exclusions:
53+
generated: strict
54+
rules:
55+
- linters:
56+
- gocyclo
57+
path: _test\.go
58+
- path: (.+)\.go$
59+
text: should have a package comment
60+
paths:
61+
- .github
62+
- resources
4763
issues:
48-
exclude-use-default: false
4964
max-issues-per-linter: 0
5065
max-same-issues: 0
51-
exclude-dirs:
52-
- .github
53-
- resources
54-
exclude:
55-
- should have a package comment
56-
exclude-rules:
57-
- path: _test\.go
58-
linters:
59-
- gocyclo
66+
formatters:
67+
enable:
68+
- gofmt
69+
settings:
70+
gofmt:
71+
simplify: true
72+
exclusions:
73+
generated: strict
74+
paths:
75+
- .github
76+
- resources

http/controller/chat/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (c *Client) readPump() {
8585
c.readErr <- errors.Errorf("read: %w", err)
8686
return
8787
}
88-
message = bytes.TrimSpace(bytes.Replace(message, newline, space, -1))
88+
message = bytes.TrimSpace(bytes.ReplaceAll(message, newline, space))
8989
c.hub.Broadcast([]byte(fmt.Sprintf("%s: %s", c.Name, message)))
9090
}
9191
}

0 commit comments

Comments
 (0)