Closed win-t closed 2 years ago
Can you please add a test so this change is not accidentally reverted in the future. Thank you.
On 15 Jan 2020, at 19:16, Kurnia D Win notifications@github.com wrote:
Some error struct have Cause() error method indicating the cause of the error, but that method could return nil indicating that that itself is the root cause in the error chain
look at this struct
type myError struct { message string cause error }
func (m *myError) Error() string { ... }
func (m *myError) Cause() error { return m.cause }
func New(message string) error { return &myError{message: message} } You can view, comment on, or merge this pull request online at:
https://github.com/pkg/errors/pull/221
Commit Summary
fix Cause File Changes
M errors.go (6) Patch Links:
https://github.com/pkg/errors/pull/221.patch https://github.com/pkg/errors/pull/221.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Also, this is a duplicate of https://github.com/pkg/errors/pull/143
Some error struct have
Cause() error
method indicating the cause of the error, but that method could return nil indicating that that itself is the root cause in the error chainlook at this struct