Avoid channel length check
Recipe ID
org.openrewrite.golang.codequality.AvoidChannelLenCheckArtifactgithub.com/moderneinc/recipes-goFind comparisons on channel length such as len(ch) == 0. These are almost always racy because the length can change between the check and the next operation.
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.AvoidChannelLenCheckIf the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-go