← All recipes
Moderne licensed

Require go-viper/mapstructure/v2 instead of mitchellh/mapstructure

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

Bring the go.mod require into line with what the source imports: repoint github.com/mitchellh/mapstructure at github.com/go-viper/mapstructure/v2 v2.5.0 once nothing imports the unmaintained module any more, and require both while a file naming the dropped mapstructure.Error still does. Does not sync go.sum, so a go mod tidy is still needed to complete resolution.

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

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

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