hooklift / gowsdl

WSDL2Go code generation as well as its SOAP proxy
Mozilla Public License 2.0
1.14k stars 390 forks source link

Separation of generated code into packages #241

Open zhorzh-p opened 2 years ago

zhorzh-p commented 2 years ago

Hello! Does the project need the ability to package generated source code to prevent namespace conflicts? And each such package will have its own imports and dependencies among themselves, if necessary

I have already started doing this for my needs. If necessary, I can then make a pull request.

leogsouza commented 2 years ago

Hello! Does the project need the ability to package generated source code to prevent namespace conflicts? And each such package will have its own imports and dependencies among themselves, if necessary

I have already started doing this for my needs. If necessary, I can then make a pull request.

Hello @zhorzh-p, can you share your implementation? I am having problem when generating my code and two different xsd files have same element name

zhorzh-p commented 2 years ago

Hi @leogsouza, I added my implementation, it's here https://github.com/hunband/gowsdl/tree/pkgseparation

I added a new flag 'multi' that separates the generated code into packages.

The program will require you to specify the names of all packages: Screenshot_1

It will then split the code into the packages you specified: Screenshot_3

And in the end, so that there are no conflicts between the created packages, you can create a go module: go mod init myservice Screenshot_4

I'm also thinking of getting rid of manual entry of package names via a support config file. Also I haven't corrected/added tests yet. There are bugs and inaccuracies in the program which I will slowly correct.

I hope it helped.