예제 #1
0
func (conn *ProtoBufConn) GetRequestBody(req *protobuf.Packet, body interface{}) error {
	if value, ok := body.(proto.Message); ok {
		return proto.Unmarshal(req.GetSerializedPacket(), value)
	}

	return fmt.Errorf("GetRequestBody value type error %v", body)
}