-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dealing with protobufs in multiple packages #240
Comments
For the Go plugin, you have to compile them one package at a time. You might find our tool helpful with that. The reason for import cycles is usually that Go has stricter cycle requirements than Protos do: Protos disallow only an import cycle of direct file-level imports. Go disallows package-level circular imports. So if Having Go-language package import circularities usually is a sign that your proto import structure is a bit confused anyway, so the reorganization will probably be clarifying. |
Also see #39 |
I believe @zellyn's answer covers this exactly. You need to come up with some division of source |
In our protobuf repo we are currently using subpackages to organize our definitions (here's a simple example https://github.com/mattberkowitz/go-proto-test), however we're having trouble compiling them into go:
go_package
option then messages in the root package that have conflicting names with messages in the sub package get overwrittenWe've considered renaming the messages in the sub package to avoid conflicts (which should allow us to use the third option above) but would prefer to keep the names as they are rather than adding unnecessary prefixes.
An ideal solution would be to be able to do something like append the subpackage name to the class when compiling into a single go package (ie
sub.TypeOne
would becomesubTypeOne
) although we've not found an option to accomplish anything like that.Any other ideas on how we might solve this problem would be greatly appreciated!
The text was updated successfully, but these errors were encountered: