> Errors in Go are, at a minimum, annotated with contextual information before being returned.
What surprised me when I last wrote Go was that there was no out-of-the-box solution to adding a stack trace to the error.
What surprised me when I last wrote Go was that there was no out-of-the-box solution to adding a stack trace to the error.
This is all to say: I can understand why they aren't more naturally part of errors, and I think it also helps explain why they are part of panics.
And with all that said, I wouldn't object to making stack traces easier to add to errors, as long as it was opt-in.