in general ,do you prefer panic/recover or passing back errors?

in general do you prefer panic/recover or passing back errors? I've been asked to review some code that is using panic/recover pretty liberally, and it's not something I have seen much of before.
You already invited:

jason

Upvotes from: dacre

i believe errors are the preferred idiomatic way. panic/recover is for exceptional issues where you don't expect the caller can handle the error. ref: https://gobyexample.com/panic and thought i've heard it mentioned before in Bill Kennedy's golang training material

dacre

Upvotes from:

I generally prefer avoiding panics at all cost.

If you wanna answer this question please Login or Register