← All recipes
Moderne licensed

Fix go.mod // indirect markers

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

Correct the // indirect markers on require directives in go.mod: a requirement is direct when a package in the module imports it and indirect otherwise. Requirements are never removed, so the change is always build-safe; a genuinely unused requirement is marked // indirect rather than removed.

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

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

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