-
Notifications
You must be signed in to change notification settings - Fork 15
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
Any <> interface Conversion #5
Comments
not sure if the protogen plugin library recognizes brackets to do stuff like One way around this is to use comments instead. each field gives us access to the comments attached to it either on top of it, or trailing it. so we could do stuff like:
also, the type of the field on the message struct is generated by protoc-gen-go, so we'd have to manipulate the AST again to achieve this, or consider forking their plugin again just out of curiosity, was using enums ever considered for the |
There is a way to do it, you just need to dig into the API. From a quick glance I think it's Yes we will definitely need to manipulate the struct codegen. Maybe we can just override that part of the AST? We did consider oneof's quite extensively and we're not going to open that can of worms again lol |
@technicallyty the problem with enums / |
Seems like we can close as "won't fix" for now? |
This will reuse the existing
cosmos_proto.implement_interface
andcosmos_proto.accepts_interface
: https://github.com/regen-network/cosmos-proto/blob/master/cosmos.protoWe want a mapping from proto interface names to golang interface names, ex:
Then the generated code should use the interface and not
Any
, ex:protoreflect.Message
and fast marshaling handling will need to be generatedbring in protoc bring in protoc-gen-go #23
struct code gen
protoreflection & proto methods
The text was updated successfully, but these errors were encountered: