← All recipes
Moderne licensed

Use named constants

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

Find numeric literals (other than 0 and 1) that should be named constants.

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

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

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