Skip to content

Commit 3b2587a

Browse files
committed
Fix internal log messages isolation + fix fmt of nolint comments
1 parent 25487fe commit 3b2587a

File tree

14 files changed

+94
-81
lines changed

14 files changed

+94
-81
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (c *config) ConnectionTTL() time.Duration {
131131
}
132132

133133
func (c *config) GrpcDialOptions() (opts []grpc.DialOption) {
134-
// nolint: gocritic
134+
// nolint:gocritic
135135
opts = append(
136136
c.grpcOptions,
137137
grpc.WithContextDialer(func(ctx context.Context, address string) (net.Conn, error) {

internal/cluster/cluster_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ func TestClusterMergeEndpoints(t *testing.T) {
131131
endpoint.New("bad:23"),
132132
}
133133
t.Run("initial fill", func(t *testing.T) {
134-
// nolint: gocritic
135-
// nolint: nolintlint
134+
// nolint:gocritic
135+
// nolint:nolintlint
136136
ne := append(endpoints, badEndpoints...)
137137
// merge new endpoints into balancer
138138
mergeEndpointIntoCluster(
@@ -146,8 +146,8 @@ func TestClusterMergeEndpoints(t *testing.T) {
146146
assert(t, ne)
147147
})
148148
t.Run("update with another endpoints", func(t *testing.T) {
149-
// nolint: gocritic
150-
// nolint: nolintlint
149+
// nolint:gocritic
150+
// nolint:nolintlint
151151
ne := append(nextEndpoints, nextBadEndpoints...)
152152
// merge new endpoints into balancer
153153
mergeEndpointIntoCluster(

internal/decimal/decimal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func Parse(s string, precision, scale uint32) (*big.Int, error) {
144144
}
145145
integral--
146146
}
147-
// nolint: nestif
147+
// nolint:nestif
148148
if len(s) > 0 { // Characters remaining.
149149
c := s[0]
150150
if !isDigit(c) {

internal/scripting/scripting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (c *client) StreamExecute(
127127
if response, err = stream.Recv(); err != nil {
128128
if !errors.Is(err, io.EOF) {
129129
r.SetErr(err)
130-
// nolint: ineffassign
130+
// nolint:ineffassign
131131
err = nil
132132
}
133133
return

internal/table/client_test.go

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestSessionPoolCreateAbnormalResult(t *testing.T) {
3636
testutil.NewCluster(
3737
testutil.WithInvokeHandlers(
3838
testutil.InvokeHandlers{
39-
// nolint: unparam
39+
// nolint:unparam
4040
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
4141
return &Ydb_Table.CreateSessionResult{
4242
SessionId: testutil.SessionID(),
@@ -93,13 +93,13 @@ func TestSessionPoolKeeperWake(t *testing.T) {
9393
testutil.NewCluster(
9494
testutil.WithInvokeHandlers(
9595
testutil.InvokeHandlers{
96-
// nolint: unparam
96+
// nolint:unparam
9797
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
9898
return &Ydb_Table.CreateSessionResult{
9999
SessionId: testutil.SessionID(),
100100
}, nil
101101
},
102-
// nolint: unparam
102+
// nolint:unparam
103103
testutil.TableKeepAlive: func(interface{}) (proto.Message, error) {
104104
keepalive <- struct{}{}
105105
return nil, nil
@@ -167,7 +167,7 @@ func TestSessionPoolCloseWhenWaiting(t *testing.T) {
167167
p := newClientWithStubBuilder(
168168
t,
169169
testutil.NewCluster(testutil.WithInvokeHandlers(testutil.InvokeHandlers{
170-
// nolint: unparam
170+
// nolint:unparam
171171
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
172172
return &Ydb_Table.CreateSessionResult{
173173
SessionId: testutil.SessionID(),
@@ -247,7 +247,7 @@ func TestSessionPoolClose(t *testing.T) {
247247
p := newClientWithStubBuilder(
248248
t,
249249
testutil.NewCluster(testutil.WithInvokeHandlers(testutil.InvokeHandlers{
250-
// nolint: unparam
250+
// nolint:unparam
251251
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
252252
return &Ydb_Table.CreateSessionResult{
253253
SessionId: testutil.SessionID(),
@@ -341,7 +341,7 @@ func TestSessionPoolDeleteReleaseWait(t *testing.T) {
341341
p := newClientWithStubBuilder(
342342
t,
343343
testutil.NewCluster(testutil.WithInvokeHandlers(testutil.InvokeHandlers{
344-
// nolint: unparam
344+
// nolint:unparam
345345
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
346346
return &Ydb_Table.CreateSessionResult{
347347
SessionId: testutil.SessionID(),
@@ -486,7 +486,7 @@ func TestSessionPoolPutInFull(t *testing.T) {
486486
p := newClientWithStubBuilder(
487487
t,
488488
testutil.NewCluster(testutil.WithInvokeHandlers(testutil.InvokeHandlers{
489-
// nolint: unparam
489+
// nolint:unparam
490490
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
491491
return &Ydb_Table.CreateSessionResult{
492492
SessionId: testutil.SessionID(),
@@ -534,7 +534,7 @@ func TestSessionPoolSizeLimitOverflow(t *testing.T) {
534534
p := newClientWithStubBuilder(
535535
t,
536536
testutil.NewCluster(testutil.WithInvokeHandlers(testutil.InvokeHandlers{
537-
// nolint: unparam
537+
// nolint:unparam
538538
testutil.TableCreateSession: func(interface{}) (result proto.Message, _ error) {
539539
return &Ydb_Table.CreateSessionResult{
540540
SessionId: testutil.SessionID(),
@@ -632,13 +632,13 @@ func TestSessionPoolGetDisconnected(t *testing.T) {
632632
testutil.NewCluster(
633633
testutil.WithInvokeHandlers(
634634
testutil.InvokeHandlers{
635-
// nolint: unparam
635+
// nolint:unparam
636636
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
637637
return &Ydb_Table.CreateSessionResult{
638638
SessionId: testutil.SessionID(),
639639
}, nil
640640
},
641-
// nolint: unparam
641+
// nolint:unparam
642642
testutil.TableKeepAlive: func(interface{}) (proto.Message, error) {
643643
keepalive <- struct{}{}
644644
// Here we are emulating blocked connection initialization.
@@ -739,14 +739,14 @@ func TestSessionPoolGetPut(t *testing.T) {
739739
testutil.NewCluster(
740740
testutil.WithInvokeHandlers(
741741
testutil.InvokeHandlers{
742-
// nolint: unparam
742+
// nolint:unparam
743743
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
744744
created++
745745
return &Ydb_Table.CreateSessionResult{
746746
SessionId: testutil.SessionID(),
747747
}, nil
748748
},
749-
// nolint: unparam
749+
// nolint:unparam
750750
testutil.TableDeleteSession: func(interface{}) (proto.Message, error) {
751751
deleted++
752752
return nil, nil
@@ -784,7 +784,7 @@ func TestSessionPoolDisableBackgroundGoroutines(t *testing.T) {
784784
p := newClientWithStubBuilder(
785785
t,
786786
testutil.NewCluster(testutil.WithInvokeHandlers(testutil.InvokeHandlers{
787-
// nolint: unparam
787+
// nolint:unparam
788788
testutil.TableCreateSession: func(interface{}) (result proto.Message, _ error) {
789789
return &Ydb_Table.CreateSessionResult{
790790
SessionId: testutil.SessionID(),
@@ -824,13 +824,13 @@ func TestSessionPoolKeepAlive(t *testing.T) {
824824
testutil.NewCluster(
825825
testutil.WithInvokeHandlers(
826826
testutil.InvokeHandlers{
827-
// nolint: unparam
827+
// nolint:unparam
828828
testutil.TableKeepAlive: func(interface{}) (proto.Message, error) {
829829
atomic.AddUint32(&keepAliveCount, 1)
830830
return &Ydb_Table.KeepAliveResult{}, nil
831831
},
832832
testutil.TableDeleteSession: okHandler,
833-
// nolint: unparam
833+
// nolint:unparam
834834
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
835835
return &Ydb_Table.CreateSessionResult{
836836
SessionId: testutil.SessionID(),
@@ -901,13 +901,13 @@ func TestSessionPoolKeepAliveOrdering(t *testing.T) {
901901
testutil.NewCluster(
902902
testutil.WithInvokeHandlers(
903903
testutil.InvokeHandlers{
904-
// nolint: unparam
904+
// nolint:unparam
905905
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
906906
return &Ydb_Table.CreateSessionResult{
907907
SessionId: testutil.SessionID(),
908908
}, nil
909909
},
910-
// nolint: unparam
910+
// nolint:unparam
911911
testutil.TableKeepAlive: func(interface{}) (proto.Message, error) {
912912
done := make(chan struct{})
913913
keepalive <- done
@@ -968,7 +968,7 @@ func TestSessionPoolDoublePut(t *testing.T) {
968968
p := newClientWithStubBuilder(
969969
t,
970970
testutil.NewCluster(testutil.WithInvokeHandlers(testutil.InvokeHandlers{
971-
// nolint: unparam
971+
// nolint:unparam
972972
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
973973
return &Ydb_Table.CreateSessionResult{
974974
SessionId: testutil.SessionID(),
@@ -1009,18 +1009,18 @@ func TestSessionPoolKeepAliveCondFairness(t *testing.T) {
10091009
testutil.NewCluster(
10101010
testutil.WithInvokeHandlers(
10111011
testutil.InvokeHandlers{
1012-
// nolint: unparam
1012+
// nolint:unparam
10131013
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
10141014
return &Ydb_Table.CreateSessionResult{
10151015
SessionId: testutil.SessionID(),
10161016
}, nil
10171017
},
1018-
// nolint: unparam
1018+
// nolint:unparam
10191019
testutil.TableKeepAlive: func(request interface{}) (proto.Message, error) {
10201020
keepalive <- request
10211021
return nil, <-keepaliveResult
10221022
},
1023-
// nolint: unparam
1023+
// nolint:unparam
10241024
testutil.TableDeleteSession: func(request interface{}) (proto.Message, error) {
10251025
deleteSession <- request
10261026
return nil, <-deleteSessionResult
@@ -1090,7 +1090,7 @@ func TestSessionPoolKeepAliveMinSize(t *testing.T) {
10901090
testutil.NewCluster(
10911091
testutil.WithInvokeHandlers(
10921092
testutil.InvokeHandlers{
1093-
// nolint: unparam
1093+
// nolint:unparam
10941094
testutil.TableCreateSession: func(interface{}) (result proto.Message, _ error) {
10951095
return &Ydb_Table.CreateSessionResult{
10961096
SessionId: testutil.SessionID(),
@@ -1157,13 +1157,13 @@ func TestSessionPoolKeepAliveWithBadSession(t *testing.T) {
11571157
testutil.NewCluster(
11581158
testutil.WithInvokeHandlers(
11591159
testutil.InvokeHandlers{
1160-
// nolint: unparam
1160+
// nolint:unparam
11611161
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
11621162
return &Ydb_Table.CreateSessionResult{
11631163
SessionId: testutil.SessionID(),
11641164
}, nil
11651165
},
1166-
// nolint: unparam
1166+
// nolint:unparam
11671167
testutil.TableKeepAlive: func(interface{}) (proto.Message, error) {
11681168
return nil, &errors.OpError{
11691169
Reason: errors.StatusBadSession,
@@ -1201,13 +1201,13 @@ func TestSessionPoolKeeperRetry(t *testing.T) {
12011201
testutil.NewCluster(
12021202
testutil.WithInvokeHandlers(
12031203
testutil.InvokeHandlers{
1204-
// nolint: unparam
1204+
// nolint:unparam
12051205
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
12061206
return &Ydb_Table.CreateSessionResult{
12071207
SessionId: testutil.SessionID(),
12081208
}, nil
12091209
},
1210-
// nolint: unparam
1210+
// nolint:unparam
12111211
testutil.TableKeepAlive: func(interface{}) (proto.Message, error) {
12121212
if retry {
12131213
retry = false
@@ -1386,15 +1386,15 @@ var okHandler = func(interface{}) (proto.Message, error) {
13861386
var simpleCluster = testutil.NewCluster(
13871387
testutil.WithInvokeHandlers(
13881388
testutil.InvokeHandlers{
1389-
// nolint: unparam
1389+
// nolint:unparam
13901390
testutil.TableExecuteDataQuery: func(interface{}) (proto.Message, error) {
13911391
return &Ydb_Table.ExecuteQueryResult{
13921392
TxMeta: &Ydb_Table.TransactionMeta{
13931393
Id: "",
13941394
},
13951395
}, nil
13961396
},
1397-
// nolint: unparam
1397+
// nolint:unparam
13981398
testutil.TableBeginTransaction: func(interface{}) (proto.Message, error) {
13991399
return &Ydb_Table.BeginTransactionResult{
14001400
TxMeta: &Ydb_Table.TransactionMeta{
@@ -1408,7 +1408,7 @@ var simpleCluster = testutil.NewCluster(
14081408
testutil.TablePrepareDataQuery: func(interface{}) (proto.Message, error) {
14091409
return &Ydb_Table.PrepareQueryResult{}, nil
14101410
},
1411-
// nolint: unparam
1411+
// nolint:unparam
14121412
testutil.TableCreateSession: func(interface{}) (proto.Message, error) {
14131413
return &Ydb_Table.CreateSessionResult{
14141414
SessionId: testutil.SessionID(),

internal/table/scanner/scanner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func (s *scanner) setColumnIndexes(columns []string) {
244244
// string
245245
// [16]byte
246246
//
247-
// nolint: gocyclo
247+
// nolint:gocyclo
248248
func (s *scanner) any() interface{} {
249249
x := s.stack.current()
250250
if s.Err() != nil || x.isEmpty() {
@@ -702,7 +702,7 @@ func (s *scanner) scanRequired(value interface{}) {
702702
}
703703
}
704704

705-
// nolint: gocyclo
705+
// nolint:gocyclo
706706
func (s *scanner) scanOptional(value interface{}) {
707707
if s.defaultValueForOptional {
708708
if s.isNull() {

internal/table/scanner/scanner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/ydb-platform/ydb-go-sdk/v3/testutil"
1616
)
1717

18-
// nolint: gocyclo
18+
// nolint:gocyclo
1919
func valueFromPrimitiveTypeID(c *column) (*Ydb.Value, interface{}) {
2020
rv := rand.Int64(math.MaxInt16)
2121
switch c.typeID {

0 commit comments

Comments
 (0)