-
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
[protobuf-go] How to access field extensions. #1528
Comments
Ah, it looks like I can use this function: https://pkg.go.dev/google.golang.org/protobuf/proto#GetExtension It might be worth documenting it here?: https://github.com/protocolbuffers/protobuf-go/blob/eba8b0975f4efc219baabc1e0e13df28a6e1ad28/reflect/protoreflect/type.go#L109 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there, I have the following protobuf file:
And I am writing a plugin in protobuf-go using protogen.
My question is: how can I access
options.pkg.name
and its value "id" from *protogen.Field?It seems that I can call
field.Desc.Options()
which does return*descriptorpb.FieldOptions
which has the options in an unexported field :extensionFields protoimpl.ExtensionFields
so I'm unable to access it.Thanks!
The text was updated successfully, but these errors were encountered: