← All recipes
Moderne licensed

Optimize copy in loop

Recipe IDorg.openrewrite.golang.codequality.OptimizeCopyInLoopArtifactgithub.com/moderneinc/recipes-go

Find copy() calls inside for/range loops. Repeated copying in loops may indicate a buffer reuse opportunity.

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.OptimizeCopyInLoop

If the recipe isn’t available locally, install it with:

mod config recipes go install github.com/moderneinc/recipes-go