Skip to content

Commit 958a6af

Browse files
committed
chore: bump go to 1.23.3 and golangci-lint to 1.61.0
Signed-off-by: mikeee <[email protected]>
1 parent dd9a2d5 commit 958a6af

File tree

7 files changed

+48
-83
lines changed

7 files changed

+48
-83
lines changed

.github/workflows/test-dapr-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
env:
2020
GOVER: ${{ matrix.gover }}
21-
GOLANGCILINT_VER: v1.55.2
21+
GOLANGCILINT_VER: v1.61.0
2222

2323
steps:
2424
- name: Checkout

.github/workflows/test-on-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- "1.22"
1919
env:
2020
GOVER: ${{ matrix.gover }}
21-
GOLANGCILINT_VER: v1.55.2
21+
GOLANGCILINT_VER: v1.61.0
2222

2323
steps:
2424
- name: Checkout

.github/workflows/test-tooling.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030
env:
3131
GOVER: ${{ matrix.gover }}
32-
GOLANGCILINT_VER: v1.55.2 # Make sure to bump /tools/check-lint-version/main_test.go
32+
GOLANGCILINT_VER: v1.61.0 # Make sure to bump /tools/check-lint-version/main_test.go
3333

3434
steps:
3535
- name: Checkout

.golangci.yml

Lines changed: 41 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ run:
44
concurrency: 4
55

66
# timeout for analysis, e.g. 30s, 5m, default is 1m
7-
deadline: 10m
7+
timeout: 15m
88

99
# exit code when at least one issue was found, default is 1
1010
issues-exit-code: 1
@@ -13,31 +13,35 @@ run:
1313
tests: true
1414

1515
# list of build tags, all linters use it. Default is empty list.
16-
#build-tags:
17-
# - mytag
16+
build-tags:
17+
- unit
18+
- allcomponents
19+
- subtlecrypto
1820

21+
# which files to skip: they will be analyzed, but issues from them
22+
# won't be reported. Default value is empty list, but there is
23+
# no need to include all autogenerated files, we confidently recognize
24+
# autogenerated files. If it's not please let us know.
25+
# skip-files:
26+
# - ".*\\.my\\.go$"
27+
# - lib/bad.go
28+
29+
issues:
1930
# which dirs to skip: they won't be analyzed;
2031
# can use regexp here: generated.*, regexp is applied on full path;
2132
# default value is empty list, but next dirs are always skipped independently
2233
# from this option's value:
2334
# third_party$, testdata$, examples$, Godeps$, builtin$
24-
skip-dirs:
35+
exclude-dirs:
2536
- ^pkg.*client.*clientset.*versioned.*
2637
- ^pkg.*client.*informers.*externalversions.*
2738
- ^pkg.*proto.*
2839

29-
# which files to skip: they will be analyzed, but issues from them
30-
# won't be reported. Default value is empty list, but there is
31-
# no need to include all autogenerated files, we confidently recognize
32-
# autogenerated files. If it's not please let us know.
33-
# skip-files:
34-
# - ".*\\.my\\.go$"
35-
# - lib/bad.go
36-
3740
# output configuration options
3841
output:
3942
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
40-
format: tab
43+
formats:
44+
- format: tab
4145

4246
# print lines of code with issue, default is true
4347
print-issued-lines: true
@@ -57,23 +61,19 @@ linters-settings:
5761
# default is false: such cases aren't reported by default.
5862
check-blank: false
5963

60-
# [deprecated] comma-separated list of pairs of the form pkg:regex
61-
# the regex is used to ignore names within pkg. (default "fmt:.*").
62-
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
63-
ignore: fmt:.*,io/ioutil:^Read.*
64+
exclude-functions:
65+
- fmt:.*
66+
- io/ioutil:^Read.*
6467

6568
# path to a file containing a list of functions to exclude from checking
6669
# see https://github.com/kisielk/errcheck#excluding-functions for details
67-
# exclude:
70+
# exclude:
6871

6972
funlen:
7073
lines: 60
7174
statements: 40
7275

7376
govet:
74-
# report about shadowed variables
75-
check-shadowing: true
76-
7777
# settings per analyzer
7878
settings:
7979
printf: # analyzer name, run `go tool vet help` to see all analyzers
@@ -86,28 +86,12 @@ linters-settings:
8686
# enable or disable analyzers by name
8787
enable:
8888
- atomicalign
89-
enable-all: false
90-
disable:
9189
- shadow
90+
enable-all: false
9291
disable-all: false
9392
revive:
94-
max-open-files: 2048
95-
# enable-all-rules: true
96-
rules:
97-
- name: cyclomatic
98-
severity: warning
99-
disabled: false
100-
arguments: [20]
101-
- name: argument-limit
102-
severity: warning
103-
disabled: false
104-
arguments: [8]
105-
- name: if-return
106-
severity: warning
107-
disabled: false
108-
- name: unused-parameter
109-
severity: warning
110-
disabled: true
93+
# minimal confidence for issues, default is 0.8
94+
confidence: 0.8
11195
gofmt:
11296
# simplify code: gofmt with `-s` option, true by default
11397
simplify: true
@@ -121,9 +105,6 @@ linters-settings:
121105
gocognit:
122106
# minimal code complexity to report, 30 by default (but we recommend 10-20)
123107
min-complexity: 10
124-
maligned:
125-
# print struct with more effective memory layout or not, false by default
126-
suggest-new: true
127108
dupl:
128109
# tokens count to trigger issue, 150 by default
129110
threshold: 100
@@ -152,10 +133,9 @@ linters-settings:
152133
desc: "you must use github.com/cenkalti/backoff/v4"
153134
misspell:
154135
# Correct spellings using locale preferences for US or UK.
155-
# Default is to use a neutral variety of English. (Do not specify a locale value)
136+
# Default is to use a neutral variety of English.
156137
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
157-
# locale:
158-
138+
# locale: default
159139
ignore-words:
160140
- someword
161141
lll:
@@ -164,12 +144,6 @@ linters-settings:
164144
line-length: 120
165145
# tab width in spaces. Default to 1.
166146
tab-width: 1
167-
unparam:
168-
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
169-
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
170-
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
171-
# with golangci-lint call it on a directory with the changed file.
172-
check-exported: false
173147
nakedret:
174148
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
175149
max-func-lines: 30
@@ -187,7 +161,7 @@ linters-settings:
187161
# See https://go-critic.github.io/overview#checks-overview
188162
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
189163
# By default list of stable checks is used.
190-
# enabled-checks:
164+
# enabled-checks:
191165

192166
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
193167
disabled-checks:
@@ -235,17 +209,20 @@ linters-settings:
235209
allow-assign-and-call: true
236210
# Allow multiline assignments to be cuddled. Default is true.
237211
allow-multiline-assign: true
238-
# Allow case blocks to end with a whitespace.
239-
force-case-trailing-whitespace: 0
240212
# Allow declarations (var) to be cuddled.
241213
allow-cuddle-declarations: false
214+
# If the number of lines in a case block is equal to or lager than this number,
215+
# the case *must* end white a newline.
216+
# https://github.com/bombsimon/wsl/blob/master/doc/configuration.md#force-case-trailing-whitespace
217+
# Default: 0
218+
force-case-trailing-whitespace: 1
242219

243220
linters:
244221
fast: false
245222
enable-all: true
246223
disable:
247224
# TODO Enforce the below linters later
248-
- nosnakecase
225+
- musttag
249226
- dupl
250227
- errcheck
251228
- funlen
@@ -254,26 +231,17 @@ linters:
254231
- gocyclo
255232
- gocognit
256233
- godox
257-
- interfacer
258234
- lll
259-
- maligned
260-
- scopelint
261235
- unparam
262236
- wsl
263237
- gomnd
264238
- testpackage
265-
- goerr113
266239
- nestif
267240
- nlreturn
268-
- tagliatelle
269-
- ifshort
270-
- forbidigo
271241
- exhaustive
272242
- exhaustruct
273-
- exhaustivestruct
274243
- noctx
275244
- gci
276-
- golint
277245
- tparallel
278246
- paralleltest
279247
- wrapcheck
@@ -287,7 +255,6 @@ linters:
287255
- varnamelen
288256
- errorlint
289257
- forcetypeassert
290-
- ifshort
291258
- maintidx
292259
- nilnil
293260
- predeclared
@@ -300,14 +267,12 @@ linters:
300267
- asasalint
301268
- rowserrcheck
302269
- sqlclosecheck
303-
- structcheck
304-
- varcheck
305-
- deadcode
306-
- golint
307270
- inamedparam
308-
issues:
309-
exclude-rules:
310-
- path: .*_test.go
311-
linters:
312-
- godot
313-
271+
- tagalign
272+
- mnd
273+
- canonicalheader
274+
- exportloopref
275+
- execinquery
276+
- err113
277+
- fatcontext
278+
- forbidigo # TODO: Re-enable and remove fmt.println

examples/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/dapr/go-sdk/examples
22

3-
go 1.22.6
3+
go 1.23.3
44

55
replace github.com/dapr/go-sdk => ../
66

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/dapr/go-sdk
22

3-
go 1.22.6
3+
go 1.23.3
44

55
require (
66
github.com/dapr/dapr v1.14.1

tools/check-lint-version/main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ func TestParseWorkflow(t *testing.T) {
2828

2929
t.Run("parse testing workflow file", func(t *testing.T) {
3030
parsedVersion, err := parseWorkflowVersionFromFile("../../.github/workflows/test-tooling.yml")
31-
assert.Equal(t, "v1.55.2", parsedVersion)
31+
assert.Equal(t, "v1.61.0", parsedVersion)
3232
require.NoError(t, err)
3333
})
3434
}
3535

3636
func TestGetCurrentVersion(t *testing.T) {
3737
t.Run("get current version from system", func(t *testing.T) {
3838
currentVersion, err := getCurrentVersion()
39-
assert.Equal(t, "v1.55.2", currentVersion)
39+
assert.Equal(t, "v1.61.0", currentVersion)
4040
require.NoError(t, err)
4141
})
4242

0 commit comments

Comments
 (0)