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

> Things can still panic in go.

Yes, but panics are intended to represent an actually exceptional situation, like dereferencing nil, or the machine running out of memory ... things that normally shouldn't happen, and from which the logic cannot easily recover.

> Error handling for an API etc usually make the most sense in a central location (

Which is doable:

    if err := couldFail(); err != nil {
        return err
    }
I can let errors bubble up the call stack as far as I want, I just have to be explicit about it.


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

Search: