Migrate encoding/json to encoding/json/v2 (all mechanical rewrites)

Proprietary

Migrate the mechanical encoding/json idioms to encoding/json/v2 by composing the streaming, MarshalIndent, function-local Encoder/Decoder, and RawMessage rewrites plus an import-only swap for files whose usage already exists in v2, adopting v2 semantics. To keep v1 output byte-identical instead, run the opt-in PreserveV1Semantics recipe afterwards.

org.openrewrite.golang.migration.MigrateToJSONV2
mod run . --recipe=org.openrewrite.golang.migration.MigrateToJSONV2

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.