code: func (e *Expander) Expand(p []byte) (q []byte, err error) {
  
  	// This is done to capture the extreme case that an out of
  	// bounds error occurs in the expansion. This should never
  	// happen, but this protects against a corrupt compressed
  	// block. If this occurs then we return no data at all to
  	// prevent any bad data being returned to the client.
  
  	defer func() {
  		if x := recover(); x != nil {
  			err = errors.New("panic caught inside expander")
  			p = p[:0]
  		}
  	}()
  
  	q = p
  A:
  	for {
  		var u uint
  		if u, err = e.readVarUint(); err != nil {
  			break A
  		}
  
  		// If the value read is zero then it indicates a compressed
  		// section which is formed of two varints indicating the
  		// offset and length, if not then it's an uncompressed section
  
  		if u == 0 {
  			var offset uint
  			if offset, err = e.readVarUint(); err != nil {
  				break A
  			}
  
  			var length uint
  			if length, err = e.readVarUint(); err != nil {
  				break A
  			}
  
  			q = append(q, e.dict[offset:offset+length]...)
  		} else {
  			left := u
  			for left > 0 {
  				buf := make([]byte, left)
  				var n int
  				if n, err = e.r.Read(buf); err != nil {
  					break A
  				}
  				if n > 0 {
  					left -= uint(n)
  					q = append(q, buf[0:n]...)
  				} else {
  					break A
  				}
  			}
  		}
  	}
  
  	if err == io.EOF {
  		err = nil
  	}
  
  	return
  }
docs: // Expand expands the compressed data into a buffer