Skip to content

Commit

Permalink
feat: use standard errors library join instead of hashicorp multierror (
Browse files Browse the repository at this point in the history
  • Loading branch information
mat007 authored Jun 4, 2024
1 parent 170be75 commit 6b19c4e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ module github.com/samber/slog-multi
go 1.21

require (
github.com/hashicorp/go-multierror v1.1.1
github.com/samber/lo v1.38.1
go.uber.org/goleak v1.2.1
)

require (
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/stretchr/testify v1.8.2 // indirect
golang.org/x/exp v0.0.0-20220303212507-bbda1eaf7a17 // indirect
)
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM=
Expand Down
6 changes: 2 additions & 4 deletions multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package slogmulti

import (
"context"
"errors"
"log/slog"

"github.com/hashicorp/go-multierror"
"github.com/samber/lo"
)

Expand Down Expand Up @@ -40,9 +40,7 @@ func (h *FanoutHandler) Handle(ctx context.Context, r slog.Record) error {
err := try(func() error {
return h.handlers[i].Handle(ctx, r.Clone())
})
if err != nil {
result = multierror.Append(result, err)
}
result = errors.Join(result, err)
}
}

Expand Down

0 comments on commit 6b19c4e

Please sign in to comment.