mirror of
https://github.com/spf13/viper
synced 2025-04-14 09:27:19 +00:00
Update update guide with mapstructure
package replacement.
This commit is contained in:
parent
cbc92421b1
commit
39ab905028
1 changed files with 11 additions and 0 deletions
11
UPGRADE.md
11
UPGRADE.md
|
@ -83,6 +83,17 @@ v := viper.NewWithOptions(
|
|||
)
|
||||
```
|
||||
|
||||
### BREAKING: "github.com/mitchellh/mapstructure" depedency replaced
|
||||
|
||||
`mapstructure` package import has changed ([#1723](https://github.com/spf13/viper/pull/1723)) and code like take does not compile anymore
|
||||
```go
|
||||
err := viper.Unmarshal(&appConfig, func(config *mapstructure.DecoderConfig) {
|
||||
config.TagName = "yaml"
|
||||
})
|
||||
```
|
||||
|
||||
To fix this issue, replace all instances of imports [`"github.com/mitchellh/mapstructure"`](https://github.com/mitchellh/mapstructure) with [`"github.com/go-viper/mapstructure/v2"`](https://github.com/go-viper/mapstructure/).
|
||||
|
||||
### BREAKING: HCL, Java properties, INI removed from core
|
||||
|
||||
In order to reduce third-party dependencies, Viper dropped support for the following formats from the core:
|
||||
|
|
Loading…
Add table
Reference in a new issue