Find unused go.mod requirements

Proprietary

Find direct require directives in go.mod that no package in the module imports. A direct requirement is only justified by a direct import, so these are candidates go mod tidy would remove or demote to // indirect. They are reported rather than removed because deciding whether a module is still needed transitively requires the module graph, which is not available offline.

org.openrewrite.golang.migration.FindUnusedGoModRequires
mod run . --recipe=org.openrewrite.golang.migration.FindUnusedGoModRequires

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