From da70fee0839cab625b0d9df6e834bc10db56437f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rk=20S=C3=A1gi-Kaz=C3=A1r?= Date: Thu, 17 Dec 2020 22:13:27 +0100 Subject: [PATCH] Add troubleshooting about unmarshaling --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index cf74954..6db0206 100644 --- a/README.md +++ b/README.md @@ -829,6 +829,7 @@ y.SetDefault("ContentDir", "foobar") When working with multiple vipers, it is up to the user to keep track of the different vipers. + ## Q & A ### 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 + +## 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.