#panic like a PRO
▻https://hackernoon.com/panic-like-a-pro-89044d5a2d35?source=rss----3a8144eabfe3---4
Advanced #go Panic ProgrammingI do it cause I need to…PrerequisitesThis article expects you to be already familiar with #golang, panic & recover functions and with any other programing language which has exceptions (try-catch) concept.IntroductionYou probably have already seen in “The Little Go Book” something like this:Go’s preferred way to deal with errors is through return values, not exceptionsAnd maybe you’ve seen ”CodeReviewComments” page on go wiki, which says:Don’t use panic for normal error handling. Use error and multiple return valuesAlso, you may have already seen “Effective Go” article which says:The usual way to report an error to a caller is to return an error as an extra return valueAlso, you may already seen on Dave Cheney’s blog article “Why Go gets exceptions right” which (...)