我想知道proto是否可以将omitempty
标签过滤到pb.go文件中。
那可能吗?还是必须由我自己在pb.go文件中进行编辑?因为我看到许多解决方案都只是用script去除了所有omitempty
。
原始变量示例:
message person {
string id
string name
int64 age
}
预期的go生成文件
type person struct {
Id string `omitted`
Name string `unomitted`
Age int64 `unomitted`
}