4 ms·
> Why does their existence mean that the other 95% of functions that can error need be given the wrong return type and pretend to return a tuple when they never
by rohansingh 3y ago
> Why does their existence mean that the other 95% of functions that can error need be given the wrong return type and pretend to return a tuple when they never do?
They don't, do they? One really nice thing about Go is writing and calling functions that _don't_ return any error. You can be confident that they will not throw any exceptions at all.
- groestl 3y ago> writing and calling functions that _don't_ return any error You are under an illusion if you think they can't fail.
- frou_dh 3y agoI said functions that error. If it has 'error' in its return type then it's such a function, e.g. (string, error)
- ikari_pl 3y agoYou can only be confident that they won't tell you what the exception was. More likely they will panic. If you're lucky, the documentation says when.