{"repo":"bracesdev/errtrace","free":true,"listed":false,"github":"https://github.com/bracesdev/errtrace","clone":"git clone https://github.com/bracesdev/errtrace.git","description":"An alternative to stack traces for your Go errors","language":"Go","stars":824,"topics":["golang"],"license":"BSD-3-Clause","category":"dev-tools","readme_excerpt":"errtrace What if every function added its location to returned errors? - Introduction - Features - Comparison with stack traces - Try it out - Why is this useful - Installation - Usage - Manual instrumentation - Automatic instrumentation - Performance - Caveats - Error wrapping - Safety - Contributing - Acknowledgements - License Introduction errtrace is an experimental package to trace an error's return path &mdash; the return trace &mdash; through a Go program. Where a stack trace tracks the code path that led to an error, a return trace tracks the code path that the error took to get to the user. Often these are the same path, but in Go they can diverge, since errors are values that can be transported across goroutines (e.g. with channels). When that happens, a return trace can be more useful than a stack trace. This library is inspired by Zig's error return traces. Features Lightweight \\ errtrace brings no other runtime dependencies with it. Simple \\ The library API is simple, straightforward, and idiomatic. Easy \\ The errtrace CLI will automatically instrument your code. Fast \\ On popular 64-bit systems, errtrace is much faster than capturing a stack trace. Comparison with stack traces With stack traces, caller information for the goroutine is captured once when the error is created. In constrast, errtrace records the caller information incrementally, following the return path the error takes to get to the user. This approach works even if the error isn't propagated dire","default_branch":null,"files":null,"tree":[],"storefront":"/r/bracesdev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bracesdev/errtrace/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}