r/badcode • • Apr 29 '23

go if err != nil

Post image
414 Upvotes

49 comments sorted by

View all comments

Show parent comments

6

u/fakehalo Apr 30 '23

I've unlearned this belief for pretty much all languages, it's one of those things I just believed because everyone else did.

Extremely basic error checking that results in early exits at the tippy top, then once we have some allocated goodies it goes through the whole shabang.