code: func convertH1ReqToH2(r *http.Request) (*bytes.Buffer, []http2.Setting, error) {
  	h2Bytes := bytes.NewBuffer([]byte((http2.ClientPreface)))
  	framer := http2.NewFramer(h2Bytes, nil)
  	settings, err := getH2Settings(r.Header)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	if err := framer.WriteSettings(settings...); err != nil {
  		return nil, nil, err
  	}
  
  	headerBytes, err := getH2HeaderBytes(r, getMaxHeaderTableSize(settings))
  	if err != nil {
  		return nil, nil, err
  	}
  
  	maxFrameSize := int(getMaxFrameSize(settings))
  	needOneHeader := len(headerBytes) < maxFrameSize
  	err = framer.WriteHeaders(http2.HeadersFrameParam{
  		StreamID:      1,
  		BlockFragment: headerBytes,
  		EndHeaders:    needOneHeader,
  	})
  	if err != nil {
  		return nil, nil, err
  	}
  
  	for i := maxFrameSize; i < len(headerBytes); i += maxFrameSize {
  		if len(headerBytes)-i > maxFrameSize {
  			if err := framer.WriteContinuation(1,
  				false, // endHeaders
  				headerBytes[i:maxFrameSize]); err != nil {
  				return nil, nil, err
  			}
  		} else {
  			if err := framer.WriteContinuation(1,
  				true, // endHeaders
  				headerBytes[i:]); err != nil {
  				return nil, nil, err
  			}
  		}
  	}
  
  	return h2Bytes, settings, nil
  }
docs: // convert the data contained in the HTTP/1 upgrade request into the HTTP/2
  // version in byte form.