mirror of
https://github.com/spf13/viper
synced 2025-05-06 20:27:17 +00:00
Use 'viper' as decoder tag name
This commit is contained in:
parent
aafc9e6bc7
commit
4a90d8c3a8
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
1
viper.go
1
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(","),
|
||||
|
|
Loading…
Add table
Reference in a new issue