From bcb420b705de7762472dda0861823d053d7f4cbd Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Fri, 8 Jun 2018 20:32:49 +0000 Subject: [PATCH] Add global UnmarshalExact method There is no helper method for UnmarshalExact which calls the corresponding method on the global viper instance. --- viper.go | 1 + 1 file changed, 1 insertion(+) diff --git a/viper.go b/viper.go index 19f15d8..6085590 100644 --- a/viper.go +++ b/viper.go @@ -949,6 +949,7 @@ 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 UnmarshalExact(rawVal interface{}) error { return v.UnmarshalExact(rawVal) } func (v *Viper) UnmarshalExact(rawVal interface{}) error { config := defaultDecoderConfig(rawVal) config.ErrorUnused = true