3 ms·
panic() and recover() are not meant to be used like Java or C++ exceptions.
by IshKebab 8y ago
panic() and recover() are not meant to be used like Java or C++ exceptions.
- vorg 8y agoThe phrase "are able to be" is more effectual than the phrase "are not meant to be" when it comes to how people use programming languages in the real world. If it's possible to build a Go system using only panic/recover and defer, just as it is using only interface{}, then there's some people who will use them that way.