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

Adding sub-plugin to protoc-gen-go #475

Closed
ashi009 opened this issue Dec 14, 2017 · 3 comments
Closed

Adding sub-plugin to protoc-gen-go #475

ashi009 opened this issue Dec 14, 2017 · 3 comments

Comments

@ashi009
Copy link

ashi009 commented Dec 14, 2017

Hi all,

It's nice that protoc-gen-go supports sub-plugins, which helped me avoids lots of boilerplates I used to write for protoc plugin.

The problem with adding a sub-plugin is that, there is no way to reuse the existing main.go when use the package as a whole. The two options are either

  • to copy the content of main file and add additional import to register my plugin, or
  • to fork this repo and add a few more files to this package.

Both options makes it difficult for me to keep things up-to-date with the upstream. Could you suggest a better way to do this?

Thanks!

@dsnet
Copy link
Member

dsnet commented Dec 14, 2017

The plugin mechanism was originally designed just for grpc and not too much though was put into how it is used today. There aren't any plans to improve plugin support for now given that other areas of Go protobufs require more attention.

Forking the repo or copying the content of the main file are fine approaches for now.

@dsnet dsnet added this to the Unplanned milestone Dec 14, 2017
@dsnet
Copy link
Member

dsnet commented Mar 8, 2018

Support for plugins in general needs to be discussed. If we decide to provide first-class support for plugins, there will probably be an entire redesign.

Closing this in favor of the umbrella issue #547.

@dsnet dsnet closed this as completed Mar 8, 2018
@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants