code: func Update(path, IP, hostname string) error {
  	defer pathLock(path)()
  
  	old, err := ioutil.ReadFile(path)
  	if err != nil {
  		return err
  	}
  	var re = regexp.MustCompile(fmt.Sprintf("(\\S*)(\\t%s)(\\s|\\.)", regexp.QuoteMeta(hostname)))
  	return ioutil.WriteFile(path, re.ReplaceAll(old, []byte(IP+"$2"+"$3")), 0644)
  }
docs: // Update all IP addresses where hostname matches.
  // path is path to host file
  // IP is new IP address
  // hostname is hostname to search for to replace IP