Ensure HTTP body closed
Recipe ID
org.openrewrite.golang.codequality.EnsureHttpBodyClosedArtifactgithub.com/moderneinc/recipes-goFind assignments of a *http.Response, as returned by http.Get, http.Post, http.Head or client.Do. Its body must be closed to avoid resource leaks.
Single recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.golang.codequality.EnsureHttpBodyClosedIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go