How to exclude a single inspect?
Answered
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?
Please sign in to leave a comment.
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.