On Monday, 2 October 2023 at 12:00:35 am UTC+11 Axel Wagner wrote:

On Sun, Oct 1, 2023 at 2:37 PM Jerry Londergaard <[email protected]> 
wrote:

I've been thinking about this point as well lately. I think I understand 
(at least some of) the conditions under which
you would call a panic(), but I still don't quite grok why it's better than 
returning an error if that error is properly 
handled.  If I panic(), then no defer() statements will be called, and I 
don't give any chance to the calling code to cleanup etc. 


`panic` does call defered functions.


You're right, I wonder how I came to this completely wrong conclusion?? 
Anyway, thanks for your insights, they are much appreciated.
 

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c78b000c-bf88-495d-9621-58a4a05c518dn%40googlegroups.com.

Reply via email to