755
756
// Parses generic values. See GenericParseHook.
757
>
func mapstructureHookGeneric(f, t reflect.Type, data any) (any, error) {
collection.go
758
>
if mth, ok := t.MethodByName("DynamicConfigParseHook"); ok &&
759
>
mth.Func.IsValid() &&
760
>
mth.Type != nil &&
761
>
mth.Type.NumIn() == 2 &&
762
>
mth.Type.In(1) == f &&
763
>
mth.Type.NumOut() == 2 &&
764
>
mth.Type.Out(0) == t &&
765
>
mth.Type.Out(1) == errorType {
766
767
out := mth.Func.Call([]reflect.Value{reflect.Zero(t), reflect.ValueOf(data)})