code: func parseBinaryContent(v string, msg proto.Message) error {
  	r := strings.NewReader(v)
  	encName, _, err := cmpbin.ReadString(r)
  	if err != nil {
  		return errors.Annotate(err, "failed to read message name").Err()
  	}
  
  	// Construct a message for this.
  	if name := proto.MessageName(msg); name != encName {
  		return errors.Reason("message name %q doesn't match encoded name %q", name, encName).Err()
  	}
  
  	// We have the right message, unmarshal.
  	d, _, err := cmpbin.ReadBytes(r)
  	if err != nil {
  		return errors.Annotate(err, "failed to read binary message content").Err()
  	}
  	if err := proto.Unmarshal(d, msg); err != nil {
  		return errors.Annotate(err, "failed to unmarshal message").Err()
  	}
  	return nil
  }
docs: // parseBinaryContent parses a binary content string, pulling out the message
  // type and marshalled message data. It then unmarshals the specified type into
  // a new message based on the archetype.
  //
  // If the binary content's declared type doesn't match the archetype, or if the
  // binary content is invalid, an error will be returned.