Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore][exporter/fileexporter] use errors.Join instead of go.uber.org/multierr #27835

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions exporter/fileexporter/buffered_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ package fileexporter // import "github.com/open-telemetry/opentelemetry-collecto

import (
"bufio"
"errors"
"io"

"go.uber.org/multierr"
)

// bufferedWriteCloser is intended to use more memory
Expand All @@ -33,7 +32,7 @@ func (bwc *bufferedWriteCloser) Write(p []byte) (n int, err error) {
}

func (bwc *bufferedWriteCloser) Close() error {
return multierr.Combine(
return errors.Join(
bwc.buffered.Flush(),
bwc.wrapped.Close(),
)
Expand Down
4 changes: 2 additions & 2 deletions exporter/fileexporter/buffered_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package fileexporter

import (
"bytes"
"errors"
"fmt"
"io"
"os"
Expand All @@ -13,7 +14,6 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/multierr"
)

const (
Expand Down Expand Up @@ -83,7 +83,7 @@ func BenchmarkWriter(b *testing.B) {
for i := 0; i < b.N; i++ {
_, err = w.Write(payload)
}
errBenchmark = multierr.Combine(err, w.Close())
errBenchmark = errors.Join(err, w.Close())
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion exporter/fileexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
go.opentelemetry.io/collector/consumer v0.87.1-0.20231017160804-ec0725874313
go.opentelemetry.io/collector/exporter v0.87.1-0.20231017160804-ec0725874313
go.opentelemetry.io/collector/pdata v1.0.0-rcv0016.0.20231017160804-ec0725874313
go.uber.org/multierr v1.11.0
gopkg.in/natefinch/lumberjack.v2 v2.2.1
)

Expand All @@ -39,6 +38,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
go.uber.org/zap v1.26.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
Expand Down
Loading