3 ms·
> Did you know io.Copy returns an error? It does, and I rarely see it handled. You don't need to explicitly '_' ignore things. Correct, and I agree this isn't
by wiremine 11y ago
> Did you know io.Copy returns an error? It does, and I rarely see it handled. You don't need to explicitly '_' ignore things.
Correct, and I agree this isn't explicit. I'd actually like to see you _not_ be able to ignore errors like this. But that's just me maybe.
> Your point makes utterly no sense to me.
My point is Go, by it's simplistic nature, more often than not forces you to at least think about the error case, instead of punting it to another part of the code. This is the point of the parent comment which I'm in agreement with.
If you're writing 'if err != nil { return nil, nil}' you're failing on oh so many levels.
Also, Java doesn't make you think about handling exceptions any more than Go does. If we're talking about code, I've seen lots of Java where the programmer figured "oh, I'll let someone else handle these exceptions..."