mirror of
https://github.com/spf13/viper
synced 2025-05-06 20:27:17 +00:00
Merge 10f9aca639
into d493c32b69
This commit is contained in:
commit
6367345ef9
1 changed files with 3 additions and 2 deletions
5
viper.go
5
viper.go
|
@ -773,8 +773,8 @@ func (v *Viper) Unmarshal(rawVal interface{}) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// defaultDecoderConfig returns default mapsstructure.DecoderConfig with suppot
|
||||
// of time.Duration values & string slices
|
||||
// defaultDecoderConfig returns default mapsstructure.DecoderConfig with support
|
||||
// of time.Duration and time.Time (RFC 3339) values and string slices
|
||||
func defaultDecoderConfig(output interface{}) *mapstructure.DecoderConfig {
|
||||
return &mapstructure.DecoderConfig{
|
||||
Metadata: nil,
|
||||
|
@ -782,6 +782,7 @@ func defaultDecoderConfig(output interface{}) *mapstructure.DecoderConfig {
|
|||
WeaklyTypedInput: true,
|
||||
DecodeHook: mapstructure.ComposeDecodeHookFunc(
|
||||
mapstructure.StringToTimeDurationHookFunc(),
|
||||
mapstructure.StringToTimeHookFunc(time.RFC3339),
|
||||
mapstructure.StringToSliceHookFunc(","),
|
||||
),
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue