2 ms·
ESBuild, one of my favourite Go projects, uses panics to handle try/catch exceptions. The syscall/js package [0] throws panics if something goes wrong, rather
by marcus_holmes 3y ago
ESBuild, one of my favourite Go projects, uses panics to handle try/catch exceptions.
The syscall/js package [0] throws panics if something goes wrong, rather than returning errors.
Go already has try/catch exceptions. We just don't use them most of the time because they're a really bad way of handling errors.
[0] https://pkg.go.dev/syscall/js https://pkg.go.dev/syscall/js