706
// Parses string into time.Duration. mapstructure has an implementation of this already but it
707
// calls time.ParseDuration and we want to use our own method.
708
>
func mapstructureHookDuration(f, t reflect.Type, data any) (any, error) {
collection.go
709
>
if t != durationType {
710
>
return data, nil
711
>
}
712
return convertDuration(data)
713
}
714
715
// Parses string or int into time.Time.
716
>
func mapstructureHookTimestamp(f, t reflect.Type, data any) (any, error) {
collection.go
717
>
if t != timeType {
718
>
return data, nil
719
>
}
720
switch v := data.(type) {
721
case time.Time: