Prefer bytes.Equal

Proprietary

Replace bytes.Compare(a, b) == 0 with bytes.Equal(a, b) and bytes.Compare(a, b) != 0 with !bytes.Equal(a, b).

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

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