Module has dependency

MSAL

Searches for Go modules that have a dependency matching the specified module path. Places a SearchResult marker on all sources within a module with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a migration to only modules that use a specific version of a library. If the search result you want is instead just the require directive in go.mod, use the DependencyInsight recipe instead.

org.openrewrite.golang.search.ModuleHasDependency

Required

A glob pattern to match Go module paths. Use * as a wildcard.

Optional

Match only dependencies with the specified version. An exact version or a version range (see the version selector syntax) may be used. Direct dependencies are compared by the version in their require directive. All versions are searched by default.

onlyDirectBoolean

If enabled, transitive dependencies will not be considered. All dependencies are searched by default.

mod run . --recipe=org.openrewrite.golang.search.ModuleHasDependency \ -P modulePattern='github.com/aws/aws-sdk-go-v2*'

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