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

    Java, C#, Python, Lisp, and Erlang would all criticize 
    Go for an unqualified new exception system
panic/recover is not an exception system in the sense that you mean. Nobody is writing large applications and using panic/recover for error handling. (At least, I hope not!) The idiomatic way of handling errors in Go is returning them explicitly, and checking for them at the call site.

    func canFail() (int, error) { ... }
    
    value, err := canFail()
    if err != nil {
        // handle
    }


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

Search: