Is it okay to use panic as a "throw" in Go?

Why? Error handling is one of the biggest perks of go. Why are you fighting it so hard? It’s designed that way for a reason.

Why on earth would that be “cleaner” code? Less lines of code, maybe, but that’s not cleaner!

Stop fighting the error handling system. It’s like that for a reason. Errors are values. It prevents second-guessing whether a method is going to Throw or not. Every error is handled explicitly.

Stop fighting the error handling system! It’s your friend!! It’s not that bad! Just do the ifferr, it’s how the language is SUPPOSED to be used

You’re driving me nuts here, u/iamrealVenom WHY would you do this except to save 4 lines of code and so you can satisfy that little stubborn part of your brain that says “ugh Go error handling is so fussy” NO maybe YOU’RE too fussy! Stop fighting! The error! Handling! System! If the language wanted you to use panic recovery/err handler it would be used much more widely.

/s

I’m hyperbolically ranting, do whatever, but just being real, it sounds dumb

/r/golang Thread