Skip to content

"Replace all" elision #10

Open
Open
@abhinav

Description

@abhinav

Currently, patches with elisions only replace the first instance of the matched contents.

For example,

 f(..., 
-  "GET",
+  constants.Get,
  ...,
 )

This will only replace the first instance in a matching function call.

// Input
foo(a, b, "GET", c, "GET", d)

// Expected
foo(a, b, constants.Get, c, constants.Get, d)

// Actual
foo(a, b, constants.Get, c, "GET", d)

gopatch should either treat ..., foo, ... transformations as "replace all", or we should add support for contextual transformations sooner (#11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions