@@ -387,16 +387,25 @@ func TestBatcher_Find(t *testing.T) {
387387
388388 t .Run ("FoundPartialBatchFilter" , func (t * testing.T ) {
389389 session := & topicreadercommon.PartitionSession {}
390- batch := mustNewBatch (session , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}, {WrittenAt : testTime (2 )}})
390+ batch := mustNewBatch (
391+ session ,
392+ []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}, {WrittenAt : testTime (2 )}},
393+ )
391394
392395 b := newBatcher ()
393396
394397 require .NoError (t , b .PushBatches (batch ))
395398
396399 findRes := b .findNeedLock (batcherGetOptions {MaxCount : 1 })
397400
398- expectedResult := newBatcherItemBatch (mustNewBatch (session , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}}))
399- expectedRestBatch := newBatcherItemBatch (mustNewBatch (session , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (2 )}}))
401+ expectedResult := newBatcherItemBatch (mustNewBatch (
402+ session ,
403+ []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}},
404+ ))
405+ expectedRestBatch := newBatcherItemBatch (mustNewBatch (
406+ session ,
407+ []* topicreadercommon.PublicMessage {{WrittenAt : testTime (2 )}},
408+ ))
400409
401410 expectedCandidate := batcherResultCandidate {
402411 Key : session ,
@@ -447,7 +456,11 @@ func TestBatcher_Apply(t *testing.T) {
447456func TestBatcherGetOptions_Split (t * testing.T ) {
448457 t .Run ("Empty" , func (t * testing.T ) {
449458 opts := batcherGetOptions {}
450- batch := mustNewBatch (nil , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}, {WrittenAt : testTime (2 )}})
459+ batch := mustNewBatch (nil , []* topicreadercommon.PublicMessage {
460+ {WrittenAt : testTime (1 )},
461+ {WrittenAt : testTime (2 )},
462+ },
463+ )
451464 head , rest , ok := opts .splitBatch (batch )
452465
453466 require .Equal (t , batch , head )
@@ -457,7 +470,11 @@ func TestBatcherGetOptions_Split(t *testing.T) {
457470 t .Run ("MinCount" , func (t * testing.T ) {
458471 opts := batcherGetOptions {MinCount : 2 }
459472 batch1 := mustNewBatch (nil , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}})
460- batch2 := mustNewBatch (nil , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}, {WrittenAt : testTime (2 )}})
473+ batch2 := mustNewBatch (nil , []* topicreadercommon.PublicMessage {
474+ {WrittenAt : testTime (1 )},
475+ {WrittenAt : testTime (2 )},
476+ },
477+ )
461478
462479 head , rest , ok := opts .splitBatch (batch1 )
463480 require .True (t , topicreadercommon .BatchIsEmpty (head ))
@@ -472,7 +489,11 @@ func TestBatcherGetOptions_Split(t *testing.T) {
472489 t .Run ("MaxCount" , func (t * testing.T ) {
473490 opts := batcherGetOptions {MaxCount : 2 }
474491 batch1 := mustNewBatch (nil , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}})
475- batch2 := mustNewBatch (nil , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (1 )}, {WrittenAt : testTime (2 )}})
492+ batch2 := mustNewBatch (nil , []* topicreadercommon.PublicMessage {
493+ {WrittenAt : testTime (1 )},
494+ {WrittenAt : testTime (2 )},
495+ },
496+ )
476497 batch3 := mustNewBatch (
477498 nil ,
478499 []* topicreadercommon.PublicMessage {
@@ -494,8 +515,20 @@ func TestBatcherGetOptions_Split(t *testing.T) {
494515 require .True (t , ok )
495516
496517 head , rest , ok = opts .splitBatch (batch3 )
497- expectedHead := mustNewBatch (nil , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (11 )}, {WrittenAt : testTime (12 )}})
498- expectedRest := mustNewBatch (nil , []* topicreadercommon.PublicMessage {{WrittenAt : testTime (13 )}, {WrittenAt : testTime (14 )}})
518+ expectedHead := mustNewBatch (
519+ nil ,
520+ []* topicreadercommon.PublicMessage {
521+ {WrittenAt : testTime (11 )},
522+ {WrittenAt : testTime (12 )},
523+ },
524+ )
525+ expectedRest := mustNewBatch (
526+ nil ,
527+ []* topicreadercommon.PublicMessage {
528+ {WrittenAt : testTime (13 )},
529+ {WrittenAt : testTime (14 )},
530+ },
531+ )
499532 require .Equal (t , expectedHead , head )
500533 require .Equal (t , expectedRest , rest )
501534 require .True (t , ok )
@@ -509,7 +542,10 @@ func TestBatcher_Fire(t *testing.T) {
509542 })
510543}
511544
512- func mustNewBatch (session * topicreadercommon.PartitionSession , messages []* topicreadercommon.PublicMessage ) * topicreadercommon.PublicBatch {
545+ func mustNewBatch (
546+ session * topicreadercommon.PartitionSession ,
547+ messages []* topicreadercommon.PublicMessage ,
548+ ) * topicreadercommon.PublicBatch {
513549 batch , err := topicreadercommon .NewBatch (session , messages )
514550 if err != nil {
515551 panic (err )
0 commit comments