code: func (c *certPool) filterCerts(certs ...*x509.Certificate) []*x509.Certificate {
  	c.lock.RLock()
  	defer c.lock.RUnlock()
  
  	filtered := []*x509.Certificate{}
  
  CertLoop:
  	for _, cert := range certs {
  		if cert == nil {
  			continue
  		}
  		possibilities := c.certsByName[string(cert.RawSubject)]
  		for _, p := range possibilities {
  			if c.certs[p].Equal(cert) {
  				continue CertLoop
  			}
  		}
  		filtered = append(filtered, cert)
  	}
  
  	//remove duplicate from list of certs being passed
  	return removeDuplicates(filtered...)
  }
docs: //filterCerts remove certs from list if they already exist in pool or duplicate