@@ -19,7 +19,7 @@ func CommitMessagesToTransaction(ctx context.Context, db *ydb.Driver, reader *to
1919 if err != nil {
2020 return err
2121 }
22- id := batch .Messages [0 ].MessageGroupID
22+ id := batch .Messages [0 ].MessageGroupID //nolint:staticcheck
2323
2424 batchResult , err := processBatch (batch .Context (), batch )
2525 if err != nil {
@@ -30,8 +30,12 @@ func CommitMessagesToTransaction(ctx context.Context, db *ydb.Driver, reader *to
3030$last = SELECT MAX(val) FROM table WHERE id=$id;
3131UPSERT INTO t (id, val) VALUES($id, COALESCE($last, 0) + $value)
3232` , query .WithParameters (
33- ydb .ParamsBuilder ().Param ("$id" ).Text (id ).Param ("$value" ).Int64 (int64 (batchResult )).Build (),
33+ ydb .ParamsBuilder ().
34+ Param ("$id" ).Text (id ).
35+ Param ("$value" ).Int64 (int64 (batchResult )).
36+ Build (),
3437 ))
38+
3539 return err
3640 })
3741 if err != nil {
@@ -51,7 +55,7 @@ func PopWithTransaction(ctx context.Context, db *ydb.Driver, reader *topicreader
5155 if err != nil {
5256 return err
5357 }
54- id := batch .Messages [0 ].MessageGroupID
58+ id := batch .Messages [0 ].MessageGroupID //nolint:staticcheck
5559
5660 batchResult , err := processBatch (batch .Context (), batch )
5761 if err != nil {
@@ -62,10 +66,13 @@ func PopWithTransaction(ctx context.Context, db *ydb.Driver, reader *topicreader
6266$last = SELECT MAX(val) FROM table WHERE id=$id;
6367UPSERT INTO t (id, val) VALUES($id, COALESCE($last, 0) + $value)
6468` , query .WithParameters (
65- ydb .ParamsBuilder ().Param ("$id" ).Text (id ).Param ("$value" ).Int64 (int64 (batchResult )).Build (),
69+ ydb .ParamsBuilder ().
70+ Param ("$id" ).Text (id ).
71+ Param ("$value" ).Int64 (int64 (batchResult )).
72+ Build (),
6673 ))
6774 if err != nil {
68- return nil
75+ return err
6976 }
7077
7178 return nil
@@ -99,7 +106,7 @@ func PopWithTransactionRecreateReader(
99106 if err != nil {
100107 return err
101108 }
102- id := batch .Messages [0 ].MessageGroupID
109+ id := batch .Messages [0 ].MessageGroupID //nolint:staticcheck
103110
104111 batchResult , err := processBatch (batch .Context (), batch )
105112 if err != nil {
@@ -109,11 +116,15 @@ func PopWithTransactionRecreateReader(
109116 _ , err = tx .Execute (ctx , `
110117$last = SELECT MAX(val) FROM table WHERE id=$id;
111118UPSERT INTO t (id, val) VALUES($id, COALESCE($last, 0) + $value)
112- ` , query .WithParameters (
113- ydb .ParamsBuilder ().Param ("$id" ).Text (id ).Param ("$value" ).Int64 (int64 (batchResult )).Build (),
114- ))
119+ ` ,
120+ query .WithParameters (
121+ ydb .ParamsBuilder ().
122+ Param ("$id" ).Text (id ).
123+ Param ("$value" ).Int64 (int64 (batchResult )).
124+ Build (),
125+ ))
115126 if err != nil {
116- return nil
127+ return err
117128 }
118129
119130 if err = tx .CommitTx (ctx ); err != nil {
0 commit comments