3 ms·
All of that sounds like more work then what you get for 0 effort with a stack trace.
by hamandcheese 3y ago
All of that sounds like more work then what you get for 0 effort with a stack trace.
- reactordev 3y agoruntime/debug PrintStack() is 0 effort… what are you going on about? Stack traces are not required, only preferred by some because they don’t program defensively. If you want to include debug information in your binaries, go for it - I’ll be waiting with Ghidra
- hamandcheese 3y agoIn other languages I don't have to explicitly print the stack. So I would not call that 0 effort. I do not care about hiding my debug symbols. Anything I write that has a binary you can touch, you can just go read the source directly.
- reactordev 3y agoNot everything is open source... I get where you are coming from but there's a lot of software out there, that is written in go, that isn't and they want to keep it that way as much as possible. go run main.go Using the go debugger in your IDE will blow up when that part of the code that panics on error is hit. Do you still need a stack trace then? You're literally looking at it in your editor. There's a time and a place for stack traces in my view and I enjoy the fact that in Go, it's not on by default. If you're building a cloud service in Go and you're unsure of your branching paths, by all means, use stack traces and eliminate your own errors.