Skip to content

Commit

Permalink
use errors.Join instead of go.uber.org/multierr
Browse files Browse the repository at this point in the history
  • Loading branch information
acha1os committed May 7, 2024
1 parent bea2130 commit 9e956ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions exporter/syslogexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.uber.org/multierr"
)

var (
Expand Down Expand Up @@ -74,7 +73,7 @@ func (cfg *Config) Validate() error {
}

if len(invalidFields) > 0 {
return multierr.Combine(invalidFields...)
return errors.Join(invalidFields...)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions exporter/syslogexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package syslogexporter // import "github.com/open-telemetry/opentelemetry-collec
import (
"context"
"crypto/tls"
"errors"
"fmt"
"strings"

Expand All @@ -14,7 +15,6 @@ import (
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/exporterhelper"
"go.opentelemetry.io/collector/pdata/plog"
"go.uber.org/multierr"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -142,7 +142,7 @@ func (se *syslogexporter) exportNonBatch(logs plog.Logs) error {

if len(errs) > 0 {
errs = deduplicateErrors(errs)
return consumererror.NewLogs(multierr.Combine(errs...), droppedLogs)
return consumererror.NewLogs(errors.Join(errs...), droppedLogs)
}

return nil
Expand Down

0 comments on commit 9e956ee

Please sign in to comment.