You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: hkdf.go
    path of file: ./repos/go-whatsapp/crypto/hkdf
    
    the code of the file until where you have to start completion: /*
HKDF is a simple key derivation function (KDF) based on
a hash-based message authentication code (HMAC)
    
func Expand(key []byte, length int, info string) ([]byte, error) {
	var h io.Reader
	if info == "" {
		/*
			Only used during initial login
			Pseudorandom Key is provided by server and has not to be created
		*/
		h = hkdf.Expand(sha256.New, key, []byte(info))
	} else {
		/*
			Used every other time
			Pseudorandom Key is created during kdf.New
			This is the normal that crypto/hkdf is used
		*/
		h = hkdf.New(sha256.New, key, nil, []byte(info))
	}
	out := make([]byte, length)
	n, err := io.ReadAtLeast(h, out, length)
	if err != nil {
		return nil, err
	}
	if n != length {
		return nil, fmt.Errorf("new key to short")
	}

	return out, nil
}