From 7f55516c32bf8ed9812b9727870345173c725d7e Mon Sep 17 00:00:00 2001 From: krishnamurthypranesh Date: Wed, 11 May 2022 17:49:20 +0530 Subject: [PATCH] :art: Combine varieable definitions to improve readability --- publisher/sns/sns.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/publisher/sns/sns.go b/publisher/sns/sns.go index 62cf7d6..7c1f41e 100644 --- a/publisher/sns/sns.go +++ b/publisher/sns/sns.go @@ -77,15 +77,14 @@ func (p *Publisher) PublishBatch(ctx context.Context, msgs []models.Message) (ma errorCount int64 successCount int64 - ) - - isFifo := strings.Contains(strings.ToLower(p.cfg.TopicArn), "fifo") - var ( numPublishedMessages = 0 start = 0 end = constants.MaxBatchSize ) + + isFifo := strings.Contains(strings.ToLower(p.cfg.TopicArn), "fifo") + if end > len(msgs) { end = len(msgs) }