-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Rip out all usage of github.com/pkg/errors
#616
Comments
What about printing stacktrace? |
I think we'll have to accept not having stack traces anymore :'( I'm disappointed that the functionality proposed in |
I would vote to keep it. Is there a reason at the moment not to use it? Sure it is archived but on the other hand pretty light weight. So maybe Go2 will support for stack traces. |
IMO we shouldn't use things that are archived. I was considering just forking the project but I want to be careful with committing myself to too many things. If someone picks it back up then we should continue to use it... the standard errors library is inferior to pkgs/errors. |
On second thought, I'm trying to contact @davecheney to see if he will let me take over maintainership. |
@LandonTClipp just curious, what is the harm of using an archived project, especially with Go's backwards compatibility guarantees? |
@scraymondjr it's the lack of maintenance support if something were to become non-functioning (it happens sometimes). It's true anyway that the standard errors package provides the error wrapping semantics that pkg/errors gives us. The stack tracing though is still not something the std lib provides. I'll defer this for a bit. I did fork |
Not sure if you had seen it but I have been using https://github.com/pingcap/errors as they have done quite a bit work in their fork to update / upgrade to support their own projects. I use this version for some of my projects. |
Two cents from a user: it would be nice to not take on a transitive dependency on a public archive especially for something that is mostly subsumed now by the Go standard library. I don't love using things like As for stack traces, is there a reason not to just use type stackErr struct {
cause error
stack []byte
}
func NewStackErr(cause error) stackErr {
return stackErr{
cause: cause,
stack: debug.Stack(),
}
}
func (e stackErr) Error() string {
return e.cause.Error()
}
func (e stackErr) Unwrap() error {
return e.cause
} |
Description
This package has been deprecated and archived, we should not use it anymore. Replace all instances of
pkg/errors
with the golang-standard packages. Use the%w
wrapping directive fromfmt.Errorf
to add contextual information to errors.pkg/errors#245
The text was updated successfully, but these errors were encountered: