How to exclude a single inspect?
已回答
I get an alert for a non-handled error in
defer resp.Body.Close()
Is it possible to exclude that single command (Body.Close() for HTTP calls) so that it does not show as an alert?
请先登录再写评论。
Hello Michael,
Yes, it's possible, and here are the steps.
Pay attention that GoLand excludes all Close() methods with the ReadCloser receiver. You can enable an inspection back in the settings: Preferences / Settings | Editor | Inspections | Probable bugs | Unhandled error and exclude a method from the list.
I hope it helps.