code: func cacheCertificate(cert Certificate) {
  	if cert.Config == nil {
  		cert.Config = new(Config)
  	}
  	certCacheMu.Lock()
  	if _, ok := certCache[""]; !ok {
  		// use as default - must be *appended* to end of list, or bad things happen!
  		cert.Names = append(cert.Names, "")
  		certCache[""] = cert
  	}
  	for len(certCache)+len(cert.Names) > 10000 {
  		// for simplicity, just remove random elements
  		for key := range certCache {
  			if key == "" { // ... but not the default cert
  				continue
  			}
  			delete(certCache, key)
  			break
  		}
  	}
  	for _, name := range cert.Names {
  		certCache[name] = cert
  	}
  	certCacheMu.Unlock()
  }
docs: // cacheCertificate adds cert to the in-memory cache. If the cache is
  // empty, cert will be used as the default certificate. If the cache is
  // full, random entries are deleted until there is room to map all the
  // names on the certificate.
  //
  // This certificate will be keyed to the names in cert.Names. Any name
  // that is already a key in the cache will be replaced with this cert.
  //
  // This function is safe for concurrent use.