2 ms·
> if you forget Does this happen? Is there any data on how often error checking is forgotten?
by saturn_vk 3y ago
> if you forget
Does this happen? Is there any data on how often error checking is forgotten?
- fl0ki 3y agoIn my experience, outright forgetting is very rare because an unused err should be a warning, but the following is not nearly as rare as it should be: if err != nil { return nil } With how boilerplate the correct version is, you learn to skip over it entirely, meaning it can be hard to spot that anything is wrong here. Linters do exist for this now, but they have so many false positives on other error handling cases that most people don't bother with them.