code: func Build(path, IP, hostname, domainname string, extraContent []Record) error {
  	defer pathLock(path)()
  
  	content := bytes.NewBuffer(nil)
  	if IP != "" {
  		//set main record
  		var mainRec Record
  		mainRec.IP = IP
  		// User might have provided a FQDN in hostname or split it across hostname
  		// and domainname.  We want the FQDN and the bare hostname.
  		fqdn := hostname
  		if domainname != "" {
  			fqdn = fmt.Sprintf("%s.%s", fqdn, domainname)
  		}
  		parts := strings.SplitN(fqdn, ".", 2)
  		if len(parts) == 2 {
  			mainRec.Hosts = fmt.Sprintf("%s %s", fqdn, parts[0])
  		} else {
  			mainRec.Hosts = fqdn
  		}
  		if _, err := mainRec.WriteTo(content); err != nil {
  			return err
  		}
  	}
  	// Write defaultContent slice to buffer
  	for _, r := range defaultContent {
  		if _, err := r.WriteTo(content); err != nil {
  			return err
  		}
  	}
  	// Write extra content from function arguments
  	for _, r := range extraContent {
  		if _, err := r.WriteTo(content); err != nil {
  			return err
  		}
  	}
  
  	return ioutil.WriteFile(path, content.Bytes(), 0644)
  }
docs: // Build function
  // path is path to host file string required
  // IP, hostname, and domainname set main record leave empty for no master record
  // extraContent is an array of extra host records.