From 12449528b23b82e5ae15cb4eecf1c57aee227973 Mon Sep 17 00:00:00 2001 From: Joonsoo Park Date: Wed, 25 Oct 2023 23:25:32 +0900 Subject: [PATCH] [chore][exporter/opensearchexporter] use errors.Join instead of go.uber.org/multierr (#27908) **Description:** use errors.Join instead of go.uber.org/multierr **Link to tracking Issue:** #25121 **Testing:** **Documentation:** --- exporter/opensearchexporter/config.go | 3 +-- exporter/opensearchexporter/go.mod | 2 +- exporter/opensearchexporter/trace_bulk_indexer.go | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/exporter/opensearchexporter/config.go b/exporter/opensearchexporter/config.go index 225c6c2c6811..891a21212159 100644 --- a/exporter/opensearchexporter/config.go +++ b/exporter/opensearchexporter/config.go @@ -8,7 +8,6 @@ import ( "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/exporter/exporterhelper" - "go.uber.org/multierr" ) const ( @@ -46,5 +45,5 @@ func (cfg *Config) Validate() error { if len(cfg.Namespace) == 0 { multiErr = append(multiErr, errNamespaceNoValue) } - return multierr.Combine(multiErr...) + return errors.Join(multiErr...) } diff --git a/exporter/opensearchexporter/go.mod b/exporter/opensearchexporter/go.mod index 24ccf8be21c4..4cbc8aacb08e 100644 --- a/exporter/opensearchexporter/go.mod +++ b/exporter/opensearchexporter/go.mod @@ -13,7 +13,6 @@ require ( go.opentelemetry.io/collector/consumer v0.88.0 go.opentelemetry.io/collector/exporter v0.88.0 go.opentelemetry.io/collector/pdata v1.0.0-rcv0017 - go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -53,6 +52,7 @@ require ( go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.17.0 // indirect golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect diff --git a/exporter/opensearchexporter/trace_bulk_indexer.go b/exporter/opensearchexporter/trace_bulk_indexer.go index e3eb7d66e97a..5c0861e9b0f3 100644 --- a/exporter/opensearchexporter/trace_bulk_indexer.go +++ b/exporter/opensearchexporter/trace_bulk_indexer.go @@ -16,7 +16,6 @@ import ( "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" - "go.uber.org/multierr" ) type traceBulkIndexer struct { @@ -31,7 +30,7 @@ func newTraceBulkIndexer(dataset string, namespace string) *traceBulkIndexer { } func (tbi *traceBulkIndexer) joinedError() error { - return multierr.Combine(tbi.errs...) + return errors.Join(tbi.errs...) } func (tbi *traceBulkIndexer) start(client *opensearch.Client) error {