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

You cannot ignore the error return value in Go.

If you would think a bit more broadly, you might also see this so that all the error handling code is visible, explicit and right there with the actual logic, and not hidden away what might be (and often is) multiple layers of modules.



>You cannot ignore the error return value in Go.

that's not true. You can ignore the second parameter by explicitly naming it with an underscore, like this:

    x, _ := MightFail()


Well ok, you can explicitly ignore them, but not by being negligent.




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

Search: