Closed shuqingzai closed 1 year ago
I don't understand your problem. Are the merge conflicts in the generated code? To solve these conflicts, you only have to rerun goverter. Additionally, it's recommended to not commit generated code, as it can easily get outdated.
You could put the generators into different packages and executed goverter for both packages.
There is also a more serious problem. As time goes by, more and more interfaces are defined and converted, and the generated file will be very large, because the generated struct will be merged into one file, which is not easy to read the code
Code readability is subjective, I mostly find it easy navigating through the single file because it's possible to navigate to the implementing method on the Converter interface.
I don't think it's worth the effort to change goverter to create separate files for the converter method implementations.
This feature was added in v1.0.0. See output:file
Have you read the project readme?
Describe your question A clear and concise description of what the question is. Include errors and go source files.
Now it seems that all defined interface generation structures will be in the same file
generated/generated.go
, but if it is developed by multiple people, my partner and I will define different interface generators, which will easily cause Git conflicts. If each structure can be generated independently file that's great