Migrate from mitchellh/mapstructure to go-viper/mapstructure/v2
ProprietaryMigrate off github.com/mitchellh/mapstructure, unmaintained since 2023, to the community fork github.com/go-viper/mapstructure/v2. v2 keeps every function, hook and DecoderConfig field of v1 and adds more, so this is a path swap. The one exception is the exported Error struct, which v2 replaced with errors.Join; a file naming it is left untouched and reported by FindMapstructureErrorUsage. Run go mod tidy afterwards to sync go.sum.
org. openrewrite. golang. migration. MigrateToGoViperMapstructuremod run . --recipe= org. openrewrite. golang. migration. MigrateToGoViperMapstructureInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.