Closed cold-bin closed 2 weeks ago
This is more or less being discussed right now over at https://github.com/golang/protobuf/issues/1619 but has also been discussed before.
The TL;DR of this is that it is unlikely we would ever add such a feature, first the json
tags we have are considered to have been a mistake. (We implemented a feature before the larger protobuf community settled on what the proper JSON encoding should be, and when that JSON encoding was defined, our implementation was not compliant.) Additionally, protobuf is a language-independant exchange format, and features that meet one and only one language are undesirable.
I’ll be closing this issue, but if you wish to continue your request, it would be better to do it in the linked issue above, which has already been discussing it.
thank you for your reply.
I want to use proto message to generate a structure as my http request data model or return data model. In this way, I can easily reuse code without creating redundancy. Therefore, I want to decide that the structure fields generated by proto message should have the ability to customize tags.
like this proto defined:
parse the proto file and add the my defined adding_tag to generated
Demo
struct.