Skip to content

Commit

Permalink
Fixed linter issues. (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmyroslav committed May 23, 2024
1 parent 615a243 commit 1651a66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ linters:
- errname
- exhaustive
- exportloopref
- gas
- gosec
- gci
- gochecknoinits
- goconst
Expand All @@ -50,7 +50,6 @@ linters:
- ineffassign
- interfacebloat
- loggercheck
- megacheck
- mirror
- misspell
- nakedret
Expand Down
4 changes: 2 additions & 2 deletions consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ func (c *SQSConsumer[T]) Consume(ctx context.Context, queueURL string, messageHa

// Wait for the poller to finish
if err := <-pollerErrCh; err != nil {
c.logger.ErrorContext(ctx, "poller error", err)
c.logger.ErrorContext(ctx, "poller error", "error", err)

return err
}

// Wait for the processor to finish consuming the messages in the buffer
if err := <-processErrCh; err != nil {
c.logger.ErrorContext(ctx, "processing error", err)
c.logger.ErrorContext(ctx, "processing error", "error", err)

return err
}
Expand Down
6 changes: 3 additions & 3 deletions consumer/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (p *processorSQS[T]) Process(ctx context.Context, msgs <-chan sqstypes.Mess

message, err := p.messageAdapter.Transform(ctx, msg)
if err != nil {
p.logger.ErrorContext(ctx, "error transforming message", err)
p.logger.ErrorContext(ctx, "error transforming message", "error", err)

continue
}
Expand All @@ -73,14 +73,14 @@ func (p *processorSQS[T]) Process(ctx context.Context, msgs <-chan sqstypes.Mess
// If the message is not processed successfully after the maximum number of retries, it will be moved to the DLQ if configured.

if err = p.acknowledger.Reject(ctx, msg); err != nil {
p.logger.ErrorContext(ctx, "error rejecting message", err)
p.logger.ErrorContext(ctx, "error rejecting message", "error", err)
}

continue
}

if err = p.acknowledger.Ack(ctx, msg); err != nil {
p.logger.ErrorContext(ctx, "error acknowledging message", err)
p.logger.ErrorContext(ctx, "error acknowledging message", "error", err)
}
}
}
Expand Down

0 comments on commit 1651a66

Please sign in to comment.