-
Notifications
You must be signed in to change notification settings - Fork 9
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
Separated package for generated mock and proto codes #4
Comments
I understand your needs very well, but there are two problems:
Then the
We tend to use
For the reasons above, generating code to a subdirectory doesn't seem to be a common behavior of Go proto plugins. I haven’t found a good solution to above problems yet, so if you have a good idea, feel free to discuss. |
Hi, sorry for a late reply
managed:
enabled: true
go_package_prefix:
default: github.com/bufbuild/connect-demo/internal/gen
I'm open to contribute on this plugin, but I need some time to learn about the codebase |
Is it possible to separate the package? We only need mock service when running unit test and won't generate it
Background
We need put generated mock inside
gen/mock
directory. The directory tree will look similar to the followingand
gen/mock/example_grpc_mock.pb.go
file will import structs fromgithub.com/example/project/gen
For further directory sample, you may see the official gomock example here
Further Discussion
If it is possible, we can refer the main generated golang code based on provided flag (i.e.
proto_import_path
)The text was updated successfully, but these errors were encountered: