3 ms·
True. I agree it could be better if omitting the check looked like the exception and not the other way around. You could also argue that encoding non-presence o
by yiyus 11y ago
True. I agree it could be better if omitting the check looked like the exception and not the other way around. You could also argue that encoding non-presence on the type is more powerful/elegant/whatever than multiple return values. But what I wanted to point out is that the problem is not that "Go indicate[s] this error case with a return of zero". The language has an easy way to check this and he ignored it (he eventually used comma-ok in his code, although he makes the check first and the assignment later in different operations for no apparent reason).