I want to mock function which takes func argument.
func SomeFunc(ctx context.Context, func(ctx context.Context) error)) error
Help please. How to do it?
I tried to mock func argument using “SetArg” but it does not work with func type:
error text
SetArg(3, …) referring to argument of non-pointer non-interface non-slice non-map type func(context.Context) error
New contributor
Amigo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.