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

docs(errors): deprecate use of errgo in ErrCtx #838

Merged
merged 2 commits into from
Feb 14, 2024
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
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
5 changes: 3 additions & 2 deletions errors/errctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ 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`).
func Notef(ctx context.Context, err error, format string, args ...interface{}) error {
return ErrCtx{ctx: ctx, err: errgo.Notef(err, format, args...)}
}
Expand Down