code: func (c *file) ID() (string, error) {
  	checkF := func() (string, error) {
  		f, err := os.Open(c.path)
  		if err != nil {
  			return "", err
  		}
  
  		data, err := ioutil.ReadAll(f)
  		if err != nil {
  			return "", err
  		}
  
  		val := strings.TrimSpace(string(data))
  		if len(val) == 0 {
  			return "", errHostIDFileEmpty
  		}
  
  		return val, nil
  	}
  
  	if c.timeout == nil {
  		return checkF()
  	}
  
  	interval := c.interval
  	if interval == 0 {
  		interval = defaultFileCheckInterval
  	}
  
  	startT := time.Now()
  	for time.Since(startT) < *c.timeout {
  		v, err := checkF()
  		if err == nil {
  			return v, nil
  		}
  
  		time.Sleep(interval)
  	}
  
  	return "", fmt.Errorf("did not find value in %s within %s", c.path, c.timeout)
  }
docs: // ID attempts to parse an ID from a  file. It will optionally wait a timeout to
  // find the value, as in some environments the file may be dynamically generated
  // from external metadata and not immediately available when the instance starts
  // up.