← All recipes
Moderne licensed

Ensure SQL connection closed

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

Find calls to sql.Open. Database connections should be managed carefully and closed when no longer needed.

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.EnsureSqlConnectionClosed

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

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