Skip to content

Commit 7017a68

Browse files
committed
docs: add migration guide
Signed-off-by: Mark Sagi-Kazar <[email protected]>
1 parent 579c0fe commit 7017a68

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ structure.
1919
go get github.com/go-viper/mapstructure/v2
2020
```
2121

22+
## Migrating from `github.com/mitchellh/mapstructure`
23+
24+
[@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.
25+
26+
You can migrate to this package by changing your import paths in your Go files to `github.com/go-viper/mapstructure/v2`.
27+
The API is the same, so you don't need to change anything else.
28+
29+
Here is a script that can help you with the migration:
30+
31+
```shell
32+
sed -i 's/github.com\/mitchellh\/mapstructure/github.com\/go-viper\/mapstructure\/v2/g' $(find . -type f -name '*.go')
33+
```
34+
35+
If you need more time to migrate your code, that is absolutely fine.
36+
37+
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:
38+
39+
```shell
40+
The repository will not go away and will only be archived
41+
```
42+
2243
## Usage & Example
2344

2445
For usage and examples see the [documentation](https://pkg.go.dev/mod/github.com/go-viper/mapstructure/v2).

0 commit comments

Comments
 (0)