diff --git a/README.md b/README.md index 64bf474..d490143 100644 --- a/README.md +++ b/README.md @@ -579,7 +579,7 @@ Example: type config struct { Port int Name string - PathMap string `mapstructure:"path_map"` + PathMap string `viper:"path_map"` } var C config diff --git a/viper.go b/viper.go index ad8a037..0acb637 100644 --- a/viper.go +++ b/viper.go @@ -774,6 +774,7 @@ func defaultDecoderConfig(output interface{}) *mapstructure.DecoderConfig { Metadata: nil, Result: output, WeaklyTypedInput: true, + TagName: "viper", DecodeHook: mapstructure.ComposeDecodeHookFunc( mapstructure.StringToTimeDurationHookFunc(), mapstructure.StringToSliceHookFunc(","),