← All recipes
Moderne licensed

Add a missing go directive

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

Add a go directive to a go.mod that has none, as go mod tidy always writes one. Defaults to the toolchain version running the recipe, the version go mod tidy would record.

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.AddMissingGoDirective

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

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