Prefer strings.ContainsAny
Recipe ID
org.openrewrite.golang.codequality.PreferStringsContainsAnyArtifactgithub.com/moderneinc/recipes-goReplace strings.IndexAny(s, chars) != -1 with strings.ContainsAny(s, chars) and strings.IndexAny(s, chars) == -1 with !strings.ContainsAny(s, chars).
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.PreferStringsContainsAnyIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go