Skip to content

Commit 0eda664

Browse files
committed
switched version of golangci-lint from v1.55.2 to 1.60.3
1 parent 7f269c8 commit 0eda664

File tree

21 files changed

+39
-51
lines changed

21 files changed

+39
-51
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88
workflow_dispatch:
99
env:
10-
GOLANGCI_LINT_VERSION: v1.55.2
10+
GOLANGCI_LINT_VERSION: v1.60.3
1111
jobs:
1212
golangci:
1313
name: golangci-lint

.golangci.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ run:
1010
#build-tags:
1111
# - mytag
1212

13-
# which dirs to skip: they won't be analyzed;
14-
# can use regexp here: generated.*, regexp is applied on full path;
15-
# default value is empty list, but next dirs are always skipped independently
16-
# from this option's value:
17-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
18-
# skip-dirs:
19-
skip-dirs-use-default: false
20-
2113
# which files to skip: they will be analyzed, but issues from them
2214
# won't be reported. Default value is empty list, but there is
2315
# no need to include all autogenerated files, we confidently recognize
@@ -30,7 +22,7 @@ run:
3022
# output configuration options
3123
output:
3224
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
33-
format: colored-line-number
25+
formats: colored-line-number
3426

3527
# print lines of code with issue, default is true
3628
print-issued-lines: true
@@ -51,10 +43,7 @@ linters-settings:
5143
check-blank: false
5244
govet:
5345
# report about shadowed variables
54-
check-shadowing: true
55-
golint:
56-
# minimal confidence for issues, default is 0.8
57-
min-confidence: 0.8
46+
shadow: true
5847
gofmt:
5948
# simplify code: gofmt with `-s` option, true by default
6049
simplify: true
@@ -222,22 +211,28 @@ linters:
222211
- cyclop
223212
- depguard
224213
- dupl
214+
- err113
225215
- exhaustive
226-
- exhaustivestruct
227216
- exhaustruct
217+
- fatcontext
228218
- forbidigo
229219
- gochecknoglobals
230220
- gocognit
221+
- gocritic
231222
- godot
232-
- goerr113
233-
- golint
223+
- gomnd
224+
- gosec
234225
- interfacebloat
226+
- intrange
235227
- ireturn
236228
- maintidx
229+
- mnd
237230
- nonamedreturns
238231
- paralleltest
239-
- structcheck
232+
- perfsprint
233+
- predeclared
240234
- testableexamples
235+
- testifylint
241236
- testpackage
242237
- thelper
243238
- varnamelen
@@ -267,6 +262,11 @@ issues:
267262
# Default value for this option is true.
268263
exclude-use-default: true
269264

265+
# Enables exclude of directories:
266+
# - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
267+
# Default: true
268+
exclude-dirs-use-default: false
269+
270270
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
271271
max-same-issues: 0
272272

@@ -302,7 +302,6 @@ issues:
302302
text: "ydb.Connection is deprecated"
303303
- path: examples
304304
linters:
305-
- gomnd
306305
- funlen
307306
- path: tests
308307
linters:

examples/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module examples
22

3-
go 1.22
3+
go 1.23
44

55
require (
66
github.com/golang-jwt/jwt/v4 v4.5.0

examples/ttl_readtable/series.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func deleteExpiredRange(ctx context.Context, c table.Client, prefix string, time
9898
// As single key range usually represents a single shard, so we batch deletions here
9999
// without introducing distributed transactions.
100100
var (
101-
docIds []uint64
101+
docIDs []uint64
102102
docID uint64
103103
ts uint64
104104
)
@@ -113,20 +113,20 @@ func deleteExpiredRange(ctx context.Context, c table.Client, prefix string, time
113113
}
114114

115115
if ts <= timestamp {
116-
docIds = append(docIds, docID)
116+
docIDs = append(docIDs, docID)
117117
}
118-
if len(docIds) >= deleteBatchSize {
119-
if err := deleteExpiredDocuments(ctx, c, prefix, docIds, timestamp); err != nil {
118+
if len(docIDs) >= deleteBatchSize {
119+
if err := deleteExpiredDocuments(ctx, c, prefix, docIDs, timestamp); err != nil {
120120
return err
121121
}
122-
docIds = []uint64{}
122+
docIDs = []uint64{}
123123
}
124124
}
125-
if len(docIds) > 0 {
126-
if err := deleteExpiredDocuments(ctx, c, prefix, docIds, timestamp); err != nil {
125+
if len(docIDs) > 0 {
126+
if err := deleteExpiredDocuments(ctx, c, prefix, docIDs, timestamp); err != nil {
127127
return err
128128
}
129-
docIds = []uint64{}
129+
docIDs = []uint64{}
130130
}
131131
}
132132

internal/balancer/connections_state_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func TestSelectRandomConnection(t *testing.T) {
232232
case "2":
233233
second++
234234
default:
235-
t.Errorf(c.Endpoint().Address())
235+
t.Error(c.Endpoint().Address())
236236
}
237237
}
238238
require.Equal(t, 100, first+second)

internal/conn/conn.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ func (c *conn) park(ctx context.Context) (err error) {
126126
}
127127

128128
err = c.close(ctx)
129-
130129
if err != nil {
131130
return xerrors.WithStackTrace(err)
132131
}

internal/conn/grpc_client_stream.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ func (s *grpcClientStream) CloseSend() (err error) {
5252
defer stop()
5353

5454
err = s.stream.CloseSend()
55-
5655
if err != nil {
5756
if xerrors.IsContextError(err) {
5857
return xerrors.WithStackTrace(err)
@@ -88,7 +87,6 @@ func (s *grpcClientStream) SendMsg(m interface{}) (err error) {
8887
defer stop()
8988

9089
err = s.stream.SendMsg(m)
91-
9290
if err != nil {
9391
if xerrors.IsContextError(err) {
9492
return xerrors.WithStackTrace(err)
@@ -144,7 +142,6 @@ func (s *grpcClientStream) RecvMsg(m interface{}) (err error) { //nolint:funlen
144142
defer stop()
145143

146144
err = s.stream.RecvMsg(m)
147-
148145
if err != nil {
149146
if xerrors.Is(err, io.EOF) {
150147
return io.EOF

internal/credentials/oauth2.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ func GetSupportedOauth2TokenExchangeJwtAlgorithms() []string {
451451
return algs
452452
}
453453

454-
//nolint:musttag
455454
type stringOrArrayConfig struct {
456455
Values []string
457456
}

internal/query/execute_query.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func readMaterializedResultSet(ctx context.Context, r *streamResult) (_ *materia
176176

177177
var rows []query.Row
178178
for {
179-
row, err := rs.nextRow(ctx) //nolint:govet
179+
row, err := rs.nextRow(ctx)
180180
if err != nil {
181181
if xerrors.Is(err, io.EOF) {
182182
break

internal/query/result_set_range_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ func TestResultSetRange(t *testing.T) {
521521
})
522522
t.Run("CanceledContext", func(t *testing.T) {
523523
childCtx, cancel := context.WithCancel(xtest.Context(t))
524+
defer cancel()
524525
stream := NewMockQueryService_ExecuteQueryClient(ctrl)
525526
stream.EXPECT().Recv().Return(&Ydb_Query.ExecuteQueryResponsePart{
526527
Status: Ydb.StatusIds_SUCCESS,

0 commit comments

Comments
 (0)