Skip to content
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

x/tools/cmd/eg: allow multiple refactorings in a single template #10143

Open
josharian opened this issue Mar 12, 2015 · 0 comments

Comments

Projects
None yet
3 participants
@josharian
Copy link
Contributor

commented Mar 12, 2015

While working on Node refactoring leading up to CL 7360, I found myself applying 8 different templates (one per relevant field) sequentially. It would be nicer to use--and I think faster to execute--to apply them all in a single pass.

The template could look like a sequence of alternating pairs of before and after:

package P

func before(s string) error { return fmt.Errorf("%s", s) }
func after(s string)  error { return errors.New(s) }

func before(msg string) { log.Fatalf("%s", msg) }
func after(msg string)  { log.Fatal(msg) }

The semantics would be that the output would be equivalent to applying each of the pairs sequentially as a template.

Thoughts? I'm happy to help with implementation.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc changed the title cmd/eg: allow multiple refactorings in a single template x/tools/cmd/eg: allow multiple refactorings in a single template Apr 14, 2015

@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015

@rsc rsc removed the repo-tools label Apr 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.