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

Separation of generated code into packages #241

Open
zhorzh-p opened this issue Jun 13, 2022 · 2 comments
Open

Separation of generated code into packages #241

zhorzh-p opened this issue Jun 13, 2022 · 2 comments

Comments

@zhorzh-p
Copy link

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
Copy link

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants