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

build: Add ability to generate package-level go protos #2

Merged
merged 2 commits into from
Aug 26, 2019

Conversation

nareddyt
Copy link
Contributor

Currently, this repository only generates cc and py protos. This change adds the ability to generate *.pb.go and *.pb.validate.go files for each package.

  • Example: bazel build //udpa/data/orca/v1:pkg_go

Note that the option go_package is no longer needed in the proto files (and should not be added!). The go_package will be set automatically to match the path.

  • Example: udpa_service_orca_v1 in the generate proto

Please see my comments in this change for more details.

Note: This change is largely based on envoyproxy/envoy#8003

Signed-off-by: Teju Nareddy [email protected]

Currently, this repository only generates cc and py protos. This change adds the ability to generate *.pb.go and *.pb.validate.go files for each package.
- Example: `bazel build //udpa/data/orca/v1:pkg_go`

Note that the option `go_package` is no longer needed in the proto files (and should not be added!). The go_package will be set automatically to match the path.
- Example: udpa_service_orca_v1

Signed-off-by: Teju Nareddy <[email protected]>
bazel/BUILD Show resolved Hide resolved
bazel/dependency_imports.bzl Show resolved Hide resolved
udpa/service/orca/v1/BUILD Show resolved Hide resolved
Copy link
Collaborator

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great.

@htuch htuch merged commit 9432480 into cncf:master Aug 26, 2019
@nareddyt nareddyt deleted the go_protos branch August 26, 2019 21:17
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

Successfully merging this pull request may close these issues.

2 participants