Rename package
Recipe ID
org.openrewrite.golang.RenamePackageArtifactgithub.com/moderneinc/recipes-goRename a Go package across a project — rewrites the package declaration in files that own the package, and rewrites import paths in every file that references it.
Single recipeProprietary
Usage
You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.golang.RenamePackage --recipe-option "oldPackagePath=github.com/old/foo" --recipe-option "newPackagePath=github.com/new/foo"If the recipe isn’t available locally, install it with:
mod config recipes go install github.com/moderneinc/recipes-goOptions
| Name | Type | Description |
|---|---|---|
oldPackagePathrequired | String | The fully qualified package path to rename. e.g. github.com/old/foo |
newPackagePathrequired | String | The fully qualified package path to use instead. e.g. github.com/new/foo |