Errors & best practices section reminded me of Rust’s error-chain. It seems clear to me something like this should be in the standard library, both for Go and for Rust.
Yeah, I really am missing ways to split the actual error i want to signal to users on my server (without leaking internal info) from debug info like stack traces.
you might try the github.com/spacemonkeygo/errors package, which has rich support for attaching stack traces and at the same time keeping the error representation separate (for instance, see github.com/spacemonkeygo/errhttp)
Looks great to me, the lack of an official package manager really hurts to be honest.
Errors & best practices section reminded me of Rust’s error-chain. It seems clear to me something like this should be in the standard library, both for Go and for Rust.
Yeah, I really am missing ways to split the actual error i want to signal to users on my server (without leaking internal info) from debug info like stack traces.
you might try the github.com/spacemonkeygo/errors package, which has rich support for attaching stack traces and at the same time keeping the error representation separate (for instance, see github.com/spacemonkeygo/errhttp)