From 8851e67356376cb7a550f167054c82bf5ae3e730 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 1 Jul 2022 13:10:53 +0800 Subject: [PATCH] dynamic: add doc comment to CallMatch Signed-off-by: c9s --- pkg/dynamic/call.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/dynamic/call.go b/pkg/dynamic/call.go index a4c45a0f1..4ba59484d 100644 --- a/pkg/dynamic/call.go +++ b/pkg/dynamic/call.go @@ -53,6 +53,10 @@ func CallStructFieldsMethod(m interface{}, method string, args ...interface{}) e } // CallMatch calls the function with the matched argument automatically +// you can define multiple parameter factory function to inject the return value as the function argument. +// e.g., +// CallMatch(targetFunction, 1, 10, true, func() *ParamType { .... }) +// func CallMatch(f interface{}, objects ...interface{}) ([]reflect.Value, error) { fv := reflect.ValueOf(f) ft := reflect.TypeOf(f)