← All recipes
Moderne licensed

Go dependency insight

Recipe IDorg.openrewrite.golang.search.DependencyInsightArtifactorg.openrewrite:rewrite-go

Find direct and transitive Go module dependencies matching a module path pattern. Results include dependencies that either directly match or transitively include a matching dependency.

Single recipeMSAL

Usage

You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.golang.search.DependencyInsight --recipe-option "modulePattern=github.com/google/*"

If the recipe isn’t available locally, install it with:

mod config recipes jar install org.openrewrite:rewrite-go:RELEASE

Options

NameTypeDescription
modulePatternrequiredStringA glob pattern to match Go module paths. Use * as a wildcard.
e.g. github.com/google/*
versionStringMatch only dependencies with the specified version. An exact version or a version range (see the version selector syntax) may be used. All versions are searched by default.
e.g. 1.x
onlyDirectBooleanIf enabled, transitive dependencies will not be considered. All dependencies are searched by default.
e.g. true

Data tables

Structured output this recipe can produce.

  • Go dependencies in useDirect and transitive dependencies in use in Go modules.org.openrewrite.golang.table.GoDependenciesInUse
  • Source files that had resultsSource files that were modified by the recipe run.org.openrewrite.table.SourcesFileResults
  • Source files that had search resultsSearch results that were found during the recipe run.org.openrewrite.table.SearchResults
  • Source files that errored on a recipeThe details of all errors produced by a recipe run.org.openrewrite.table.SourcesFileErrors
  • Recipe performanceStatistics used in analyzing the performance of recipes.org.openrewrite.table.RecipeRunStats