Bläddra i källkod

goprotobuf: Clarify Unmarshaler semantics.

R=r
CC=golang-dev
http://codereview.appspot.com/6820111
David Symonds 13 år sedan
förälder
incheckning
7d3c680f41
1 ändrade filer med 5 tillägg och 3 borttagningar
  1. 5 3
      proto/decode.go

+ 5 - 3
proto/decode.go

@@ -282,9 +282,11 @@ func (o *Buffer) skip(t reflect.Type, tag, wire int) error {
 	return err
 }
 
-// Unmarshaler is the interface representing objects that can unmarshal themselves.
-// The argument points to data that may be overwritten, so implementations should
-// not keep references to the buffer.
+// Unmarshaler is the interface representing objects that can
+// unmarshal themselves.  The method should reset the receiver before
+// decoding starts.  The argument points to data that may be
+// overwritten, so implementations should not keep references to the
+// buffer.
 type Unmarshaler interface {
 	Unmarshal([]byte) error
 }