From 16834edb1504a7e8f3d7bc9daf143e1f1ea7deb7 Mon Sep 17 00:00:00 2001 From: Samantha Coyle Date: Tue, 19 Nov 2024 20:23:50 -0600 Subject: [PATCH] style: make linter happy Signed-off-by: Samantha Coyle --- common/authentication/aws/x509.go | 2 +- common/component/kafka/clients.go | 1 + common/component/kafka/kafka.go | 1 - common/component/kafka/kafka_test.go | 2 +- common/component/kafka/producer.go | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/authentication/aws/x509.go b/common/authentication/aws/x509.go index 25c615bd42..0b560f5c5a 100644 --- a/common/authentication/aws/x509.go +++ b/common/authentication/aws/x509.go @@ -463,7 +463,7 @@ func (a *x509) refreshClient() { for { newSession, err := a.createOrRefreshSession(context.Background()) if err == nil { - err := a.clients.refresh(newSession) + err = a.clients.refresh(newSession) if err != nil { a.logger.Errorf("Failed to refresh client, retrying in 5 seconds: %w", err) } diff --git a/common/component/kafka/clients.go b/common/component/kafka/clients.go index 7331bd4b00..8e8111b7b2 100644 --- a/common/component/kafka/clients.go +++ b/common/component/kafka/clients.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/IBM/sarama" + awsAuth "github.com/dapr/components-contrib/common/authentication/aws" ) diff --git a/common/component/kafka/kafka.go b/common/component/kafka/kafka.go index 88aef85ac7..b147aaae4b 100644 --- a/common/component/kafka/kafka.go +++ b/common/component/kafka/kafka.go @@ -124,7 +124,6 @@ func NewKafka(logger logger.Logger) *Kafka { } } - // Init does metadata parsing and connection establishment. func (k *Kafka) Init(ctx context.Context, metadata map[string]string) error { upgradedMetadata, err := k.upgradeMetadata(metadata) diff --git a/common/component/kafka/kafka_test.go b/common/component/kafka/kafka_test.go index ea6834ba66..ab4362738c 100644 --- a/common/component/kafka/kafka_test.go +++ b/common/component/kafka/kafka_test.go @@ -421,7 +421,7 @@ func TestValidateAWS(t *testing.T) { } else { require.NoError(t, err) } - assert.Equal(t, result, tt.expected) + assert.Equal(t, tt.expected, result) }) } } diff --git a/common/component/kafka/producer.go b/common/component/kafka/producer.go index 33e5dd4fa3..65a8a0771b 100644 --- a/common/component/kafka/producer.go +++ b/common/component/kafka/producer.go @@ -93,7 +93,7 @@ func (k *Kafka) Publish(_ context.Context, topic string, data []byte, metadata m func (k *Kafka) BulkPublish(_ context.Context, topic string, entries []pubsub.BulkMessageEntry, metadata map[string]string) (pubsub.BulkPublishResponse, error) { clients, err := k.latestClients() if err != nil || clients == nil { - err := fmt.Errorf("failed to get latest Kafka clients: %w", err) + err = fmt.Errorf("failed to get latest Kafka clients: %w", err) return pubsub.NewBulkPublishResponse(entries, err), err } if clients.producer == nil {