Use 'viper' as decoder tag name

This commit is contained in:
Tyler Bunnell 2018-01-29 13:09:32 -07:00
parent aafc9e6bc7
commit 4a90d8c3a8
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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(","),