Use package-level error sentinel
Recipe ID
org.openrewrite.golang.codequality.UsePackageLevelErrorSentinelArtifactgithub.com/moderneinc/recipes-goMove inline errors.New("...") calls to package-level sentinel variables so they can be compared with errors.Is. Each distinct message becomes one sentinel per package, declared in the first file that uses it and referenced from every other.
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.UsePackageLevelErrorSentinelIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go