code: func New(content string, level RecoveryLevel) (*QRCode, error) {
  	encoders := []dataEncoderType{dataEncoderType1To9, dataEncoderType10To26,
  		dataEncoderType27To40}
  
  	var encoder *dataEncoder
  	var encoded *bitset.Bitset
  	var chosenVersion *qrCodeVersion
  	var err error
  
  	for _, t := range encoders {
  		encoder = newDataEncoder(t)
  		encoded, err = encoder.encode([]byte(content))
  
  		if err != nil {
  			continue
  		}
  
  		chosenVersion = chooseQRCodeVersion(level, encoder, encoded.Len())
  
  		if chosenVersion != nil {
  			break
  		}
  	}
  
  	if err != nil {
  		return nil, err
  	} else if chosenVersion == nil {
  		return nil, errors.New("content too long to encode")
  	}
  
  	q := &QRCode{
  		Content: content,
  
  		Level:         level,
  		VersionNumber: chosenVersion.version,
  
  		ForegroundColor: color.Black,
  		BackgroundColor: color.White,
  
  		encoder: encoder,
  		data:    encoded,
  		version: *chosenVersion,
  	}
  
  	q.encode(chosenVersion.numTerminatorBitsRequired(encoded.Len()))
  
  	return q, nil
  }
docs: // New constructs a QRCode.
  //
  //	var q *qrcode.QRCode
  //	q, err := qrcode.New("my content", qrcode.Medium)
  //
  // An error occurs if the content is too long.