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

Understand decl groupings #3

Open
abhinav opened this issue Apr 21, 2021 · 4 comments
Open

Understand decl groupings #3

abhinav opened this issue Apr 21, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@abhinav
Copy link
Contributor

abhinav commented Apr 21, 2021

For gopatch, currently the following are different:

var foo = 42

var (
  foo = 42
)

gopatch should understand decl groupings for types, consts, vars, and funcs so that these are treated as equivalent.

Ideally it should also understand which of those groupings are unordered so the following are considered equivalent by a patch.

type (
  Foo struct{}
  Bar struct{}
)

type (
  Bar struct{}
  Foo struct{}
)
@abhinav abhinav added the enhancement New feature or request label Apr 21, 2021
@sywhang
Copy link
Contributor

sywhang commented Jun 17, 2021

Ideally it should also understand which of those groupings are unordered so the following are considered equivalent by a patch.

@abhinav, did you mean to say these are considered equivalent:

type (
  Foo struct{}
  Bar struct{}
)

type (
  Bar struct{}
  Foo struct{}
)

instead of:

type (
  Foo struct{}
  Bar struct{}
)

type (
  Foo struct{}
  Bar struct{}
)

@abhinav
Copy link
Contributor Author

abhinav commented Jun 22, 2021

Hey @sywhang. Yeah, I meant the first case, but what's different between the two versions in the second case?

@sywhang
Copy link
Contributor

sywhang commented Jun 22, 2021

The second struct has "Bar" before "Foo" whereas the example structs in the issue are completely identical structs 😁

@abhinav
Copy link
Contributor Author

abhinav commented Jun 22, 2021

Derp. My bad. Fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants