Is there anyone else who'd like to see https://github.com/pkg/errors (or similar) being adopted in Go 2.0?
Forked from #21161 (comment).
Example:
func Chdir(dir string) error {
if e := syscall.Chdir(dir); e != nil {
return errors.Wrap(e, "failed to change directory")
}
return nil
}
Alternative one-liner example, since errors.Wrap() returns nil on nil error:
func Chdir(dir string) error {
return errors.Wrap(syscall.Chdir(dir), "failed to change directory")
}
Is there anyone else who'd like to see https://github.com/pkg/errors (or similar) being adopted in Go 2.0?
Forked from #21161 (comment).
Example:
Alternative one-liner example, since errors.Wrap() returns
nilonnilerror: