4 ms·
It is in Go Lang which shares error handling philosophy with GP.
by lanstin 5y ago
It is in Go Lang which shares error handling philosophy with GP.
- ziml77 5y agoGo panics do not simply abort. "For a real-world example of panic and recover, see the json package from the Go standard library. It encodes an interface with a set of recursive functions. If an error occurs when traversing the value, panic is called to unwind the stack to the top-level function call, which recovers from the panic and returns an appropriate error value (see the ‘error’ and ‘marshal’ methods of the encodeState type in encode.go)." From https://go.dev/blog/defer-panic-and-recover https://go.dev/blog/defer-panic-and-recover
- lanstin 5y agoBut philosophically, they should just abort.