vsphere/config.go
func (c *Config) readRestSessionID() (string, error) {
	if !c.Persist {
		return "", nil
	}

	p, err := c.restSessionFile()
	if err != nil {
		return "", err
	}
	log.Printf("[DEBUG] Attempting to locate REST client session data in %q", p)
	id, err := ioutil.ReadFile(p)
	if err != nil {
		if os.IsNotExist(err) {
			log.Printf("[DEBUG] REST client session data not found in %q", p)
			return "", nil
		}

		return "", err
	}

	return string(id), nil
}
func (c *Config) readRestSessionID() (string, error) {
	if !c.Persist {
		return "", nil
	}

	p, err := c.restSessionFile()
	if err != nil {
		return "", err
	}
	log.Printf("[DEBUG] Attempting to locate REST client session data in %q", p)
	id, err := ioutil.ReadFile(p)
	if err != nil {
		if os.IsNotExist(err) {
			log.Printf("[DEBUG] REST client session data not found in %q", p)
			return "", nil
		}

		return "", err
	}

	return string(id), nil
}
// readRestSessionID reads a saved REST session ID and returns it. An empty
// string is returned if session does not exist.