Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks for the explanation. In most cases cleanup is handled in finally blocks and the unit of work fails if any of N calls fails, in most case it makes no difference which one failed. Where the difference does matter it's probably in a different method etc.

Your explanation does seem to make the case for this type of error seem somewhat sensible, maybe I'll give Go another try. Are methods which return errors and the types of errors returned clearly documented/visible?



Methods' declarations indicate which ones return an error value. E.g.:

    func Demo (s string) (string, error){...}
When called, that is guaranteed to return a string and an error value (OR nil).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: