code: func (p *Processor) Marshal(msg interface{}) ([][]byte, error) {
  	msgType := reflect.TypeOf(msg)
  
  	// id
  	_id, ok := p.msgID[msgType]
  	if !ok {
  		err := fmt.Errorf("message %s not registered", msgType)
  		return nil, err
  	}
  
  	id := make([]byte, 2)
  	if p.littleEndian {
  		binary.LittleEndian.PutUint16(id, _id)
  	} else {
  		binary.BigEndian.PutUint16(id, _id)
  	}
  
  	// data
  	data, err := proto.Marshal(msg.(proto.Message))
  	return [][]byte{id, data}, err
  }
docs: // goroutine safe