3 ms·
The article as well as several comments repeat that “Go forces you to think about the error”. But isn’t that the opposite of what the tuple return pattern does?
by alkonaut 4y ago
The article as well as several comments repeat that “Go forces you to think about the error”. But isn’t that the opposite of what the tuple return pattern does? It allows you to ignore any error you want?
It’s just like an integer error code in C or bash, you check it when you remember but no one stops you from using the value even in the error case.
If the result and error was a single value (which I assume is the alternative here - not some Java-style exception system) then you’d be forced to consider the error.
The best you can do with a r, e tuple is checking if e isn’t nil over and over possibly cheered on by a linter?