Simplify redundant len check before range

Proprietary

Remove if len(s) > 0 { for ... range s } where the len check is redundant because range over nil/empty produces zero iterations.

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

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