On Mon, Apr 24, 2017 at 1:06 PM Kevin Conway <kevinjacobcon...@gmail.com>
wrote:

> Any code that invokes panic is very clearly stating that an error has
occurred that is completely unrecoverable and the _only_ choice of action
that could possibly be taken is to end the program.

It's sometimes a perfectly valid and quite reasonable approach to defer a
recover() in an API function and panic(forWhateverReason) somewhere down
the call chain. A recursive descent parser may get much simpler and easier
to code, for example.

Notice that real unrecoverable errors are not subject to defer/recover() at
all.

-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to