4 ms·
Unless edited, I don't think that's what GP said. Panics are the way to get stacktraces, not the way to routinely handle errors. Your top level comment about 4
by BlueDingo 7y ago
Unless edited, I don't think that's what GP said. Panics are the way to get stacktraces, not the way to routinely handle errors.
Your top level comment about 403 errors made me assume you did not know about panic. Obviously your particular situation may have prevented it but I've always built Go programs from source (not linking binaries) which means I could always panic whenever I needed a stack trace.
- omegabravo 7y agoPanics provide stacktraces, but are not the way to get stack traces. runtime/debug has the API to generate stacktraces. github.com/pkg/errors is the ubiquitous library for seamlessly including stacktraces in errors