Use bytes.ReplaceAll

Proprietary

Replace bytes.Replace(b, old, new, -1) with bytes.ReplaceAll(b, old, new).

org.openrewrite.golang.codequality.UseBytesReplaceAll
mod run . --recipe=org.openrewrite.golang.codequality.UseBytesReplaceAll

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.