2 ms·
You understand go doesn't have exceptions right?
by LtWorf 2y ago
You understand go doesn't have exceptions right?
- pjmlp 2y agoYou understand that I wrote C code, and in what concerns Go, panic/recover are exceptions that don't want to assume themselves as such?
- LtWorf 2y agoYou can't handle a panic, it's the whole point.
- 9rx 2y agoIn C, you mean? You clearly can in Go. How would you deal with exceptions otherwise? You can even get silly with it: func main() { try(func() { throw("Oops") }).catch(func(e any) { fmt.Println("Caught:", e) }) } https://go.dev/play/p/Y1-w9xUXIcO https://go.dev/play/p/Y1-w9xUXIcO