Remove redundant type conversion
Recipe ID
org.openrewrite.golang.codequality.RemoveRedundantTypeConversionArtifactgithub.com/moderneinc/recipes-goRemove a conversion whose operand already has the target type, such as string(s) where s is a string. byte and uint8 name one type, as do rune and int32, so a conversion between either pair is removed too. A conversion of an untyped constant is what gives the constant its type, so it stays.
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.RemoveRedundantTypeConversionIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go