code: func MakeCSRFromTemplate(privateKey interface{}, template *x509.CertificateRequest) ([]byte, error) {
  	t := *template
  	t.SignatureAlgorithm = sigType(privateKey)
  
  	csrDER, err := x509.CreateCertificateRequest(cryptorand.Reader, &t, privateKey)
  	if err != nil {
  		return nil, err
  	}
  
  	csrPemBlock := &pem.Block{
  		Type:  CertificateRequestBlockType,
  		Bytes: csrDER,
  	}
  
  	return pem.EncodeToMemory(csrPemBlock), nil
  }
docs: // MakeCSRFromTemplate generates a PEM-encoded CSR using the supplied private
  // key and certificate request as a template. All key types that are
  // implemented via crypto.Signer are supported (This includes *rsa.PrivateKey
  // and *ecdsa.PrivateKey.)