← All recipes
Moderne licensed

Add missing go.mod requirements

Recipe IDorg.openrewrite.golang.migration.AddMissingGoModRequiresArtifactgithub.com/moderneinc/recipes-go

Add require directives for modules the resolved build list needs but go.mod does not declare, at their resolved versions and with the // indirect marker the toolchain assigned. Mirrors what go mod tidy adds, using the module graph resolved at parse time.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.golang.migration.AddMissingGoModRequires

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

mod config recipes go install github.com/moderneinc/recipes-go