我正在使用谷歌grpc与json代理.由于某种原因,我需要omitempty从*.pb.go文件中生成的结构中删除标记.
如果我有这样的原型消息
message Status {
int32 code = 1;
string message = 2;
}
Run Code Online (Sandbox Code Playgroud)
生成的结构看起来像这样
type Status struct {
Code int32 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
}
Run Code Online (Sandbox Code Playgroud)
但我需要omitempty从生成的结构中删除标记.我怎样才能做到这一点?