code: func putVLQ(target []byte, n uint64) int {
  	offset := 0
  	for ; ; offset++ {
  		// The high bit is set when another byte follows.
  		highBitMask := byte(0x80)
  		if offset == 0 {
  			highBitMask = 0x00
  		}
  
  		target[offset] = byte(n&0x7f) | highBitMask
  		if n <= 0x7f {
  			break
  		}
  		n = (n >> 7) - 1
  	}
  
  	// Reverse the bytes so it is MSB-encoded.
  	for i, j := 0, offset; i < j; i, j = i+1, j-1 {
  		target[i], target[j] = target[j], target[i]
  	}
  
  	return offset + 1
  }
docs: // putVLQ serializes the provided number to a variable-length quantity according
  // to the format described above and returns the number of bytes of the encoded
  // value.  The result is placed directly into the passed byte slice which must
  // be at least large enough to handle the number of bytes returned by the
  // serializeSizeVLQ function or it will panic.