Message user is like this
message User {
int32 uid = 1;
string username = 2;
string password = 3;
}
The go code generated by looks like this:
type User struct {
Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
I directly use the above User
to deposit MySQL will make an error, because XXX_NoUnkeyedLiteral
these fields do not exist, there is a solution is that I manually change the generated code, ignore these fields , but I do not know how to do it?