• close up shot of a toy

    How to fix Viper unmarshal error for nested structs

    Let’s say you have the following structs that you need to unmarshal using Go’s Viper library (Go configuration with fangs). It’s intended to parse the configuration file you have found on config.yaml on your root folder, which looks something like this: Symptom or Problem Sometimes you encounter unmarshalling errors when using viper.Unmarshal, or sometimes there…