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

In this case, the if err != nil is completely useless.

Usually the pattern is used to perform better error handling (wrapping errors) or in case you call multiple functions that might return an error.

In this case, your suggestion is actually what I would expect to see



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

Search: