From 579c0fe9ed2f0693945b5b6cf75c38c7a23f08fc Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Tue, 19 Dec 2023 22:02:02 +0100 Subject: [PATCH 1/2] docs: fix readme Signed-off-by: Mark Sagi-Kazar --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 811b38c..2b28db8 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,6 @@ structure. ## Installation -For the time being, you can use this library as a drop-in replacement for the original library: - ```shell go get github.com/go-viper/mapstructure/v2 ``` From 7017a6863b515862519986cb92c5ea9c61413740 Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Fri, 22 Dec 2023 15:31:58 +0100 Subject: [PATCH 2/2] docs: add migration guide Signed-off-by: Mark Sagi-Kazar --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 2b28db8..45e6ad7 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,27 @@ structure. go get github.com/go-viper/mapstructure/v2 ``` +## Migrating from `github.com/mitchellh/mapstructure` + +[@mitchehllh](https://github.com/mitchellh) announced his intent to archive some of his unmaintained projects (see [here](https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc) and [here](https://github.com/mitchellh/mapstructure/issues/349)). This is a repository achieved the "blessed fork" status. + +You can migrate to this package by changing your import paths in your Go files to `github.com/go-viper/mapstructure/v2`. +The API is the same, so you don't need to change anything else. + +Here is a script that can help you with the migration: + +```shell +sed -i 's/github.com\/mitchellh\/mapstructure/github.com\/go-viper\/mapstructure\/v2/g' $(find . -type f -name '*.go') +``` + +If you need more time to migrate your code, that is absolutely fine. + +Some of the latest fixes are backported to the v1 release branch of this package, so you can use the Go modules `replace` feature until you are ready to migrate: + +```shell +The repository will not go away and will only be archived +``` + ## Usage & Example For usage and examples see the [documentation](https://pkg.go.dev/mod/github.com/go-viper/mapstructure/v2).