code: func DetectPacket(src []byte) (int, Type) {
  	// check for minimum size
  	if len(src) < 2 {
  		return 0, 0
  	}
  
  	// get type
  	t := Type(src[0] >> 4)
  
  	// get remaining length
  	rl, n := binary.Uvarint(src[1:])
  	if n <= 0 {
  		return 0, 0
  	}
  
  	return 1 + n + int(rl), t
  }
docs: // DetectPacket tries to detect the next packet in a buffer. It returns a length
  // greater than zero if the packet has been detected as well as its Type.