← All recipes
Moderne licensed

Find encoding/json usage for the v2 migration

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

Inventory every encoding/json (v1) touchpoint that an encoding/json/v2 migration must address: the import, package functions, Encoder/Decoder and other type methods (resolved through the type system, so receivers reached via variables, parameters, or fields are all found), exported types, [N]byte/time.Duration struct fields, omitempty and ,string tags, and custom MarshalJSON/UnmarshalJSON implementations. Findings populate a data table categorized as import, rewrite, review, or modernize. This recipe reports only and does not modify code.

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

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

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