gofumpt: don't include unnecessary duplicate types in function args
The following are equivalent:
func add(x int, y int) int
func add(x, y int) int
The second, however is shorter. Maybe gofumpt should rewrite the first to be the second?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (16 by maintainers)
Commits related to this issue
- merge adjacent types in function parameters Fixes #53. — committed to mvdan/gofumpt by twpayne 4 years ago
- README: document joining parameters See #53. — committed to mvdan/gofumpt by mvdan 4 years ago
Hey @twpayne to meet in person is boring, so I decided to stalk you also online 😉
We will fix our code generator, even if you decided not to implement this feature.
I agree with @twpayne that the generator should be fixed in any case, but we can add @SchumacherFM’s surprise to the bucket of reasons why we probably shouldn’t do this transformation by default (see my last comment).
👋 @SchumacherFM we finally meet online!
To be fair, if the code generator is incorrectly ignoring arguments in valid Go code, this sounds like a bug in the code generator and is unrelated to gofumpt.