4 ms·
> You are never forced to check or handle errors. It's easy to accidentally miss an `if err != nil` check, I've seen sages and newbies alike make this mistake.
by aiono 2y ago
> You are never forced to check or handle errors. It's easy to accidentally miss an `if err != nil` check, I've seen sages and newbies alike make this mistake.
While I also don't like Go's error handling approach I thought Go compiler gives an error if a variable is unused, in this case `err`. Is this not the case?
- richbell 2y ago> While I also don't like Go's error handling approach I thought Go compiler gives an error if a variable is unused, in this case `err`. Is this not the case? This isn't foolproof. If you're calling multiple methods and reusing `err` it won't give an error because it's technically not unused.
- aiono 2y agoI didn't know that, this seems like a big foot gun tbh