I have two protocol buffers, X and Y as defined below:
message X {
string value1 = 1;
enum Status {
STATUS_UNSPECIFIED = 0;
ACTIVE = 1;
DELETED = 2;
}
Status status = 2;
}
message Y {
string value2 = 1;
enum Status {
STATUS_UNSPECIFIED = 0;
ACTIVE = 1;
DELETED = 2;
}
Status status = 2;
}
I have an instance of X
, say x
. How can I assign x.status
to a new y.status
of type Y
easily in Go?