3 ms·
As you probably already know, panic/recover/defer are not supposed to be used in the same way as try/catch/finally. They're different features for different pur
by enneff 11y ago
As you probably already know, panic/recover/defer are not supposed to be used in the same way as try/catch/finally. They're different features for different purposes.
If you want error handling in Go, use error values.
- pcwalton 11y agoSure. Panic, recover, and defer are in the language, though, and are more complex than exceptions regardless of how they're intended to be used.