Skip to content

Commit

Permalink
fix(errors): do not use errgo in New methods
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneM committed Feb 13, 2024
1 parent 49be268 commit 50ee664
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions errors/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## To be Released

* docs(errors): deprecate use of `errgo` in `ErrCtx`

## v2.3.0

* feat: add `Is` and `As` to match standard library
Expand Down
4 changes: 2 additions & 2 deletions errors/errctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ func (err ErrCtx) Unwrap() error {
}

func New(ctx context.Context, message string) error {
return ErrCtx{ctx: ctx, err: errgo.New(message)}
return ErrCtx{ctx: ctx, err: errors.New(message)}
}

func Newf(ctx context.Context, format string, args ...interface{}) error {
return ErrCtx{ctx: ctx, err: errgo.Newf(format, args...)}
return Errorf(ctx, format, args...)
}

// Deprecated: Use `Wrap` or `Wrapf` instead of `Notef`. The library is able to unwrap mixed errors (wrapped with `errgo` or `github.com/pkg/errors`).
Expand Down

0 comments on commit 50ee664

Please sign in to comment.