code: func bitsetDecodePartialBytes(data []byte, target int) ([]byte, int, error) {
  	// Sanity check 0 targets to avoid infinite recursion
  	if target == 0 {
  		return nil, 0, nil
  	}
  	// Handle the zero and single byte corner cases
  	decomp := make([]byte, target)
  	if len(data) == 0 {
  		return decomp, 0, nil
  	}
  	if target == 1 {
  		decomp[0] = data[0] // copy to avoid referencing the input slice
  		if data[0] != 0 {
  			return decomp, 1, nil
  		}
  		return decomp, 0, nil
  	}
  	// Decompress the bitset of set bytes and distribute the non zero bytes
  	nonZeroBitset, ptr, err := bitsetDecodePartialBytes(data, (target+7)/8)
  	if err != nil {
  		return nil, ptr, err
  	}
  	for i := 0; i < 8*len(nonZeroBitset); i++ {
  		if nonZeroBitset[i/8]&(1<<byte(7-i%8)) != 0 {
  			// Make sure we have enough data to push into the correct slot
  			if ptr >= len(data) {
  				return nil, 0, errMissingData
  			}
  			if i >= len(decomp) {
  				return nil, 0, errExceededTarget
  			}
  			// Make sure the data is valid and push into the slot
  			if data[ptr] == 0 {
  				return nil, 0, errZeroContent
  			}
  			decomp[i] = data[ptr]
  			ptr++
  		}
  	}
  	return decomp, ptr, nil
  }
docs: // bitsetDecodePartialBytes decompresses data with a known target size, but does
  // not enforce consuming all the input bytes. In addition to the decompressed
  // output, the function returns the length of compressed input data corresponding
  // to the output as the input slice may be longer.