diff --git a/pkg/kafka/client/reader_client.go b/pkg/kafka/client/reader_client.go index e8bbb2da8c86..d02c3c7fe91f 100644 --- a/pkg/kafka/client/reader_client.go +++ b/pkg/kafka/client/reader_client.go @@ -9,7 +9,6 @@ import ( "github.com/go-kit/log" "github.com/go-kit/log/level" - "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/twmb/franz-go/pkg/kadm" "github.com/twmb/franz-go/pkg/kgo" @@ -36,7 +35,7 @@ func NewReaderClient(kafkaCfg kafka.Config, metrics *kprom.Metrics, logger log.L ) client, err := kgo.NewClient(opts...) if err != nil { - return nil, errors.Wrap(err, "creating kafka client") + return nil, fmt.Errorf("creating kafka client: %w", err) } if kafkaCfg.AutoCreateTopicEnabled { setDefaultNumberOfPartitionsForAutocreatedTopics(kafkaCfg, client, logger) diff --git a/pkg/kafka/partition/reader_service.go b/pkg/kafka/partition/reader_service.go index 53f92366dc49..dedcf183485c 100644 --- a/pkg/kafka/partition/reader_service.go +++ b/pkg/kafka/partition/reader_service.go @@ -91,10 +91,10 @@ func NewReaderService( ) if err != nil { - return nil, errors.Wrap(err, "creating kafka reader") + return nil, fmt.Errorf("creating kafka reader: %w", err) } - return newReaderServiceFromIfc( + return newReaderService( ReaderConfig{ TargetConsumerLagAtStartup: kafkaCfg.TargetConsumerLagAtStartup, MaxConsumerLagAtStartup: kafkaCfg.MaxConsumerLagAtStartup, @@ -107,7 +107,7 @@ func NewReaderService( ), nil } -func newReaderServiceFromIfc( +func newReaderService( cfg ReaderConfig, reader Reader, consumerFactory ConsumerFactory,