Discriminate between mode empty and invalid (#1410)
This commit is contained in:
parent
77552ad722
commit
8834e26adf
5 changed files with 47 additions and 27 deletions
|
|
@ -10,7 +10,10 @@ func DecodeOther(other interface{}, cc interface{}) error {
|
|||
Result: cc,
|
||||
ErrorUnused: true,
|
||||
WeaklyTypedInput: true,
|
||||
DecodeHook: mapstructure.StringToTimeDurationHookFunc(),
|
||||
DecodeHook: mapstructure.ComposeDecodeHookFunc(
|
||||
mapstructure.StringToTimeDurationHookFunc(),
|
||||
mapstructure.TextUnmarshallerHookFunc(),
|
||||
),
|
||||
}
|
||||
|
||||
decoder, err := mapstructure.NewDecoder(decoderConfig)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue