I’ve used protopatch <https://github.com/alta/protopatch> successfully to 
solve similar problems.

Cheers,
:) Hein
On Saturday, November 27, 2021 at 4:53:06 PM UTC+1 Sankar wrote:

> Hi
>
> I have a database that has a column `2xxCode`. This database is part of a 
> legacy system and I cannot make changes to this, as there are multiple 
> applications that depend on this, and some of the applications are 
> unchangeable.
>
> Now I want to create a new gRPC server in golang that has to interact with 
> the data stored in this database.
>
> Since golang variable names cannot begin with a number, I need create a 
> `.proto` file which should generate a golang struct member like:
>
> type mystruct {
>     TwoxxCode `db:"2xxCode"`
> }
>
> from my .proto file. But I could not find out how to generate a golang 
> struct from a .proto file, with adding custom tags to the struct. On 
> searching, I found https://github.com/golang/protobuf/issues/52 and the 
> second comment on the issue seems very strongly worded as if this would 
> never happen in protobuf. Also, the bug seems open for a long time.
>
> How have others solved this problem to add custom tags to proto generated 
> golang structs ? Are there any best-known-methods for this ? There were a 
> couple of scripts mentioned in the comments, but I am not sure what to 
> pick. Any recommendations ?
>
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/638fbec3-58ab-4012-9ad6-54994c7d19bcn%40googlegroups.com.

Reply via email to