Remove if/else with identical branches
Recipe ID
org.openrewrite.golang.codequality.AllBranchesIdenticalArtifactgithub.com/moderneinc/recipes-goReplace an if/else chain where every branch has the same body with just the body, since the conditions have no effect on the outcome.
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.AllBranchesIdenticalIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go