← All recipes
Moderne licensed

Migrate encoding/json to encoding/json/v2, preserving v1 semantics

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

Migrate encoding/json to encoding/json/v2 while preserving v1 behavior, by composing MigrateToJSONV2 and PreserveV1Semantics. Use it instead of MigrateToJSONV2 for a low-disruption migration.

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

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

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