code: func OverrideHosts(template *x509.Certificate, hosts []string) {
  	if hosts != nil {
  		template.IPAddresses = []net.IP{}
  		template.EmailAddresses = []string{}
  		template.DNSNames = []string{}
  		template.URIs = []*url.URL{}
  	}
  
  	for i := range hosts {
  		if ip := net.ParseIP(hosts[i]); ip != nil {
  			template.IPAddresses = append(template.IPAddresses, ip)
  		} else if email, err := mail.ParseAddress(hosts[i]); err == nil && email != nil {
  			template.EmailAddresses = append(template.EmailAddresses, email.Address)
  		} else if uri, err := url.ParseRequestURI(hosts[i]); err == nil && uri != nil {
  			template.URIs = append(template.URIs, uri)
  		} else {
  			template.DNSNames = append(template.DNSNames, hosts[i])
  		}
  	}
  
  }
docs: // OverrideHosts fills template's IPAddresses, EmailAddresses, DNSNames, and URIs with the
  // content of hosts, if it is not nil.