Checkpoint.

This commit is contained in:
Matt T. Proud 2013-03-01 09:51:36 -08:00
parent 41068c2e84
commit f39b9c3c8e
7 changed files with 284 additions and 110 deletions

View file

@ -21,8 +21,15 @@ type ProtocolBufferEncoder struct {
message proto.Message
}
func (p *ProtocolBufferEncoder) Encode() ([]byte, error) {
return proto.Marshal(p.message)
func (p *ProtocolBufferEncoder) Encode() (raw []byte, err error) {
raw, err = proto.Marshal(p.message)
// XXX: Adjust legacy users of this to not check for error.
if err != nil {
panic(err)
}
return
}
func NewProtocolBufferEncoder(message proto.Message) *ProtocolBufferEncoder {