← All recipes
Moderne licensed

Ensure HTTP body closed

Recipe IDorg.openrewrite.golang.codequality.EnsureHttpBodyClosedArtifactgithub.com/moderneinc/recipes-go

Find 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.EnsureHttpBodyClosed

If the recipe isn’t available locally, install it with:

mod config recipes go install github.com/moderneinc/recipes-go