goprotobuf: Handle XXX_unrecognized correctly.
In particular,
- add it to marshaled messages
- examine it in Clone, Equal
R=r
CC=golang-dev
http://codereview.appspot.com/6449091
diff --git a/proto/equal.go b/proto/equal.go
index f68ffcc..8c26e75 100644
--- a/proto/equal.go
+++ b/proto/equal.go
@@ -126,7 +126,11 @@
}
}
- // TODO: Deal with XXX_unrecognized.
+ u1 := v1.FieldByName("XXX_unrecognized").Bytes()
+ u2 := v2.FieldByName("XXX_unrecognized").Bytes()
+ if !bytes.Equal(u1, u2) {
+ return false
+ }
return true
}