dimanche 28 octobre 2018

Inspect Protobuf type using reflection in golang

I have compiled and imported a protocol buffer package with several types in go.

In my go program, I'd like to inspect one of those type given the name of the type in a variable. How can that be done?

For example, if the .proto is defined as:

message foo {
    String bar = 1;
}

How can I get the type foo from my go program, assuming I have a variable that equals foo





Aucun commentaire:

Enregistrer un commentaire