Hacker News new | past | comments | ask | show | jobs | submit login

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




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: