|
|
|
|
|
by omegabravo
2431 days ago
|
|
> If it’s is trivial, why isn’t in the standard library Getting a stack trace is available in the runtime/debug library. Perhaps stack traces aren't in normal errors since a program can throw 1,000 errors per second in a perfectly functioning application and that could get expensive. I have heard that performance is the reason but I'm not able to confirm that. github.com/pkg/errors is fairly ubiquitous and includes stack traces. > If everyone needs to do it, why not standardize The only time I've needed to read the stack trace in go, is when there has been an unexpected panic. Otherwise my error messages are more than sufficient to find the root cause of the error. I only have to run my own code though, I imagine if I was debugging someone elses code the stacktrace would be invaluable. Go has purposely tried to do a few things differently. Date format comes to mind, and lack of exceptions which I personally like. |
|