Open akamensky opened 2 years ago
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