Add troubleshooting about unmarshaling

This commit is contained in:
Márk Sági-Kazár 2020-12-17 22:13:27 +01:00 committed by GitHub
parent 99da8b22a1
commit da70fee083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -829,6 +829,7 @@ y.SetDefault("ContentDir", "foobar")
When working with multiple vipers, it is up to the user to keep track of the When working with multiple vipers, it is up to the user to keep track of the
different vipers. different vipers.
## Q & A ## Q & A
### Why is it called “Viper”? ### Why is it called “Viper”?
@ -853,3 +854,9 @@ There has been several attempts to implement case sensitivity, but unfortunately
You can vote for case sensitivity by filling out this feedback form: https://forms.gle/R6faU74qPRPAzchZ9 You can vote for case sensitivity by filling out this feedback form: https://forms.gle/R6faU74qPRPAzchZ9
## Troubleshooting
### Unmarshaling doesn't work
The most common reason for this issue is improper use of struct tags (eg. `yaml` or `json`). Viper uses [github.com/mitchellh/mapstructure](https://github.com/mitchellh/mapstructure) under the hood for unmarshaling values which uses `mapstructure` tags by default. Please refer to the library's documentation for using other struct tags.