-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change WorkFunction to anonymous function #6
Comments
I provided an changeset for this. The code change is minimal, mostly changes are in tests. However I'd suggest to not merge it as-is to v2.0.0 because this will break compatibility for those using this library |
v3.0.0 adds support for passing a context, please check if this satisfies your requirement. |
It doesn't. Instantiating a new type object doesn't allow for this whatsoever. Contexts semantically are not for passing variables. And there are way more flexibility with anonymous functions than with context. |
I manage to pass more variables like this: https://github.com/ricardobranco777/regview/blob/master/print.go#L18 |
Is your feature request related to a problem? Please describe.
Since this is right now declared as an interface with a single
Run()
method I am unable to pass any other variables as part of context.Describe the solution you'd like
Using anonymous function instead of interface we don't need to declare any new types and are able to use execution context. Such as (from the example code):
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: