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

featuregate: replace go.uber.org/multierr with stdlib errors #11105

Closed
Closed
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
11 changes: 6 additions & 5 deletions featuregate/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
package featuregate // import "go.opentelemetry.io/collector/featuregate"

import (
"errors"
"flag"
"strings"

"go.uber.org/multierr"
)

const (
Expand Down Expand Up @@ -47,7 +46,7 @@ func (f *flagValue) Set(s string) error {
return nil
}

var errs error
var errs []error
ids := strings.Split(s, ",")
for i := range ids {
id := ids[i]
Expand All @@ -59,7 +58,9 @@ func (f *flagValue) Set(s string) error {
case '+':
id = id[1:]
}
errs = multierr.Append(errs, f.reg.Set(id, val))
if err := f.reg.Set(id, val); err != nil {
errs = append(errs, err)
}
}
return errs
return errors.Join(errs...)
}
1 change: 0 additions & 1 deletion featuregate/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/hashicorp/go-version v1.7.0
github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
)

require (
Expand Down
2 changes: 0 additions & 2 deletions featuregate/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.