Skip to content

Commit d73708a

Browse files
authored
Merge pull request #1031 from NovruzovE/master
Enable maligned linter
2 parents a1b6511 + 874f830 commit d73708a

File tree

14 files changed

+60
-83
lines changed

14 files changed

+60
-83
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ linters:
240240
- interfacebloat
241241
- ireturn
242242
- maintidx
243-
- maligned
244243
- nonamedreturns
245244
- paralleltest
246245
- scopelint

driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import (
5050
var _ Connection = (*Driver)(nil)
5151

5252
// Driver type provide access to YDB service clients
53-
type Driver struct { //nolint:maligned
53+
type Driver struct {
5454
ctx context.Context // cancel while Driver.Close called.
5555
ctxCancel context.CancelFunc
5656

internal/background/worker.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,15 @@ var (
1919

2020
// A Worker must not be copied after first use
2121
type Worker struct {
22-
ctx context.Context
23-
workers sync.WaitGroup
24-
onceInit sync.Once
25-
22+
ctx context.Context
23+
workers sync.WaitGroup
24+
closeReason error
2625
tasksCompleted empty.Chan
27-
28-
m xsync.Mutex
29-
30-
tasks chan backgroundTask
31-
32-
closed bool
33-
stop context.CancelFunc
34-
closeReason error
26+
tasks chan backgroundTask
27+
stop context.CancelFunc
28+
onceInit sync.Once
29+
m xsync.Mutex
30+
closed bool
3531
}
3632

3733
type CallbackFunc func(ctx context.Context)

internal/coordination/config/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66
)
77

88
// Config is an configuration of coordination client
9-
//
10-
//nolint:maligned
119
type Config struct {
1210
config.Common
1311

internal/grpcwrapper/rawtopic/rawtopicreader/messages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ type UpdateTokenRequest struct {
9090
}
9191

9292
type UpdateTokenResponse struct {
93+
rawtopiccommon.UpdateTokenResponse
94+
9395
serverMessageImpl
9496

9597
rawtopiccommon.ServerMessageMetadata
96-
97-
rawtopiccommon.UpdateTokenResponse
9898
}
9999

100100
//

internal/grpcwrapper/rawtopic/rawtopicwriter/messages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ type UpdateTokenRequest struct {
303303
}
304304

305305
type UpdateTokenResponse struct {
306+
rawtopiccommon.UpdateTokenResponse
307+
306308
serverMessageImpl
307309

308310
rawtopiccommon.ServerMessageMetadata
309-
310-
rawtopiccommon.UpdateTokenResponse
311311
}

internal/ratelimiter/config/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66
)
77

88
// Config is a configuration of ratelimiter client
9-
//
10-
//nolint:maligned
119
type Config struct {
1210
config.Common
1311

internal/scheme/config/config.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66
)
77

88
// Config is a configuration of scheme client
9-
//
10-
//nolint:maligned
119
type Config struct {
1210
config.Common
1311

internal/table/session.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,15 @@ import (
4545
// Note that after session is no longer needed it should be destroyed by
4646
// Close() call.
4747
type session struct {
48+
onClose []func(s *session)
4849
id string
4950
tableService Ydb_Table_V1.TableServiceClient
51+
status table.SessionStatus
5052
config *config.Config
51-
52-
status table.SessionStatus
53-
statusMtx sync.RWMutex
54-
nodeID atomic.Uint32
55-
lastUsage atomic.Int64
56-
57-
onClose []func(s *session)
58-
closeOnce sync.Once
53+
lastUsage atomic.Int64
54+
statusMtx sync.RWMutex
55+
closeOnce sync.Once
56+
nodeID atomic.Uint32
5957
}
6058

6159
func (s *session) LastUsage() time.Time {

internal/topic/topicreaderinternal/stream_reconnector.go

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,24 @@ var (
2929
type readerConnectFunc func(ctx context.Context) (batchedStreamReader, error)
3030

3131
type readerReconnector struct {
32-
clock clockwork.Clock
33-
background background.Worker
34-
35-
tracer *trace.Topic
36-
baseContext context.Context
37-
retrySettings topic.RetrySettings
38-
39-
readerConnect readerConnectFunc
40-
41-
reconnectFromBadStream chan reconnectRequest
42-
connectTimeout time.Duration
43-
44-
closeOnce sync.Once
45-
readerID int64
46-
47-
m xsync.RWMutex
48-
streamConnectionInProgress empty.Chan // opened if connection in progress, closed if connection established
32+
background background.Worker
33+
clock clockwork.Clock
34+
baseContext context.Context
35+
retrySettings topic.RetrySettings
4936
streamVal batchedStreamReader
5037
streamErr error
5138
closedErr error
52-
53-
initErr error
54-
initDone bool
55-
initDoneCh empty.Chan
39+
initErr error
40+
tracer *trace.Topic
41+
readerConnect readerConnectFunc
42+
reconnectFromBadStream chan reconnectRequest
43+
connectTimeout time.Duration
44+
readerID int64
45+
streamConnectionInProgress empty.Chan // opened if connection in progress, closed if connection established
46+
initDoneCh empty.Chan
47+
m xsync.RWMutex
48+
closeOnce sync.Once
49+
initDone bool
5650
}
5751

5852
//nolint:revive

0 commit comments

Comments
 (0)