← All recipes
Moderne licensed

Order imports

Recipe IDorg.openrewrite.golang.OrderImportsArtifactgithub.com/moderneinc/recipes-go

Sort import lines into stdlib / third-party / local groups. Within each group, entries are alphabetized; non-empty groups are separated by a blank line. Mirrors goimports -w. Local detection uses the sibling go.mod's module path.

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

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

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