3 ms·
Yup, I wrote it that way because I have a linter for unused error returns with a handful of exceptions (like closing http request bodies).
by iudqnolq 2y ago
Yup, I wrote it that way because I have a linter for unused error returns with a handful of exceptions (like closing http request bodies).
- klodolph 2y agoI think I would add an exception for this too, because it crops up a lot.
- iudqnolq 2y agoI can't decide because in this pattern you ignore once and check once and I like the lint for the check. Ideally the linter could recognize this pattern. Even better would be if the linter could catch when you never close, I've made that mistake a few times.