4 ms·
In 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() {
by 9rx 2y ago
In 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