mirror of
https://github.com/spf13/viper
synced 2025-05-07 04:37:20 +00:00
Added opts to DecoderConfigOption
This commit is contained in:
parent
62edee3196
commit
c66462282e
1 changed files with 2 additions and 2 deletions
4
viper.go
4
viper.go
|
@ -851,8 +851,8 @@ func decode(input interface{}, config *mapstructure.DecoderConfig) error {
|
|||
|
||||
// UnmarshalExact unmarshals the config into a Struct, erroring if a field is nonexistent
|
||||
// in the destination struct.
|
||||
func (v *Viper) UnmarshalExact(rawVal interface{}) error {
|
||||
config := defaultDecoderConfig(rawVal)
|
||||
func (v *Viper) UnmarshalExact(rawVal interface{}, opts ...DecoderConfigOption) error {
|
||||
config := defaultDecoderConfig(rawVal, opts...)
|
||||
config.ErrorUnused = true
|
||||
|
||||
err := decode(v.AllSettings(), config)
|
||||
|
|
Loading…
Add table
Reference in a new issue