← All recipes
Moderne licensed

Use ctx for context.Context parameter

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

Rename function parameters of type context.Context that are not named "ctx" to "ctx", including all usages in the function body.

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

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

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