dynamic: add doc comment to CallMatch

Signed-off-by: c9s <yoanlin93@gmail.com>
This commit is contained in:
c9s 2022-07-01 13:10:53 +08:00
parent 910c17a567
commit 8851e67356
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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)