func skipVarint(buf []byte) []byte {
	i := 0
	for ; buf[i]&0x80 != 0; i++ {
	}
	return buf[i+1:]
}
Support for the message_set_wire_format message option.
package proto
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"reflect"
	"sort"
)
var ErrNoMessageTypeId = errors.New("proto does not have a message type ID")
type _MessageSet_Item struct {
	TypeId  *int32 `protobuf:"varint,2,req,name=type_id"`
	Message []byte `protobuf:"bytes,3,req,name=message"`
}
type MessageSet struct {
	Item             []*_MessageSet_Item `protobuf:"group,1,rep"`
	XXX_unrecognized []byte
}
var _ Message = (*MessageSet)(nil)
type messageTypeIder interface {
	MessageTypeId() int32
}
func (ms *MessageSet) find(pb Message) *_MessageSet_Item {
	mti, ok := pb.(messageTypeIder)
	if !ok {
		return nil
	}
	id := mti.MessageTypeId()
	for _, item := range ms.Item {
		if *item.TypeId == id {
			return item
		}
	}
	return nil
}
func (ms *MessageSet) Has(pb Message) bool {
	if ms.find(pb) != nil {
		return true
	}
	return false
}
func (ms *MessageSet) Unmarshal(pb Message) error {
	if item := ms.find(pb); item != nil {
		return Unmarshal(item.Message, pb)
	}
	if _, ok := pb.(messageTypeIder); !ok {
		return ErrNoMessageTypeId
	}
	return nil  
}
func (ms *MessageSet) Marshal(pb Message) error {
	msg, err := Marshal(pb)
	if err != nil {
		return err
	}
	if item := ms.find(pb); item != nil {
		item.Message = msg
		return nil
	}
	mti, ok := pb.(messageTypeIder)
	if !ok {
		return ErrNoMessageTypeId
	}
	mtid := mti.MessageTypeId()
	ms.Item = append(ms.Item, &_MessageSet_Item{
		TypeId:  &mtid,
		Message: msg,
	})
	return nil
}
func (ms *MessageSet) Reset()         { *ms = MessageSet{} }
func (ms *MessageSet) String() string { return CompactTextString(ms) }
func (*MessageSet) ProtoMessage()     {}