3 ms·
Indeed. Also, this notion that Go makes one think about all the errors is false. What happens to the errors from all the "defer foo.CloseOrMaybeFailSomehow()"
by topspin 4y ago
Indeed. Also, this notion that Go makes one think about all the errors is false.
What happens to the errors from all the "defer foo.CloseOrMaybeFailSomehow()" that get run on early return? Answer: they're ignored. Ignoring errors baked right in. Yes, you can handle them with a closure, but I can count on part of one hand the number of times I've actually seen that. And I know why: because at some point the regression gets unreasonable and people just pretend they didn't see it and thank their makers the compiler lets them get away with it, this blog post in question being a fine example of that.
So I know what sort of malarkey I'm reading when this "think about the errors" gets bandied about.