code: func ParseCertsPEM(pemCerts []byte) ([]*x509.Certificate, error) {
  	ok := false
  	certs := []*x509.Certificate{}
  	for len(pemCerts) > 0 {
  		var block *pem.Block
  		block, pemCerts = pem.Decode(pemCerts)
  		if block == nil {
  			break
  		}
  		// Only use PEM "CERTIFICATE" blocks without extra headers
  		if block.Type != CertificateBlockType || len(block.Headers) != 0 {
  			continue
  		}
  
  		cert, err := x509.ParseCertificate(block.Bytes)
  		if err != nil {
  			return certs, err
  		}
  
  		certs = append(certs, cert)
  		ok = true
  	}
  
  	if !ok {
  		return certs, errors.New("data does not contain any valid RSA or ECDSA certificates")
  	}
  	return certs, nil
  }
docs: // ParseCertsPEM returns the x509.Certificates contained in the given PEM-encoded byte array
  // Returns an error if a certificate could not be parsed, or if the data does not contain any certificates