The eg tool can execute simple refactoring steps, but automating context
plumbing through a chain of calls is an open problem. Alan Donovan put some
thought into this a few years ago, and I've done a limited form of this
using awk ;-)

On Tue, May 9, 2017 at 6:10 AM <mhhc...@gmail.com> wrote:

> I want something similar too.
>
> Automatic and smart insertion of context args in a chain of calls.
>
> Methods signature updates are easy, but how to appropriately insert
> context check in the ast  ?
> I m not sure yet.
>
>
> >The difficulty here seems to differentiate intra package calls from calls
> to standard/3rd party libraries which shouldn't be having new param.
>
> That does not sound too difficult, from the pkg identifier, lookup for the
> import path, for every import path, exists in GOROOT ?
>
> Please put updates here anything you want to share.
>
> At that moment i m using this package to help me with ast,
> https://github.com/mh-cbon/astutil
>
> might be a start even though it needs refactoring.
>
>
> On Monday, May 8, 2017 at 1:03:52 AM UTC+2, meir fischer wrote:
>>
>> I'm adding tracing to an existing code base with many packages and it
>> seems the best way to have context's passed around is to just have every
>> method take a context.Context.
>>
>> Is there any tooling for converting a code base/package to have:
>> (a) context.Context as the first parameter in each function - ctx
>> context.Context
>> (b) for any function that has changed, have its callers (within that
>> package) pass ctx as the first arg
>>
>> The difficulty here seems to differentiate intra package calls from calls
>> to standard/3rd party libraries which shouldn't be having new param.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to