code: func (d *deployerImpl) getCurrentInstanceID(packageDir string) (string, error) {
  	var current string
  	var err error
  	if runtime.GOOS == "windows" {
  		var bytes []byte
  		bytes, err = ioutil.ReadFile(filepath.Join(packageDir, currentTxt))
  		if err == nil {
  			current = strings.TrimSpace(string(bytes))
  		}
  	} else {
  		current, err = os.Readlink(filepath.Join(packageDir, currentSymlink))
  	}
  	if err != nil {
  		if os.IsNotExist(err) {
  			return "", nil
  		}
  		return "", err
  	}
  	if err = common.ValidateInstanceID(current, common.AnyHash); err != nil {
  		return "", fmt.Errorf(
  			"pointer to currently installed instance doesn't look like a valid instance id: %s", err)
  	}
  	return current, nil
  }
docs: // getCurrentInstanceID returns instance ID of currently installed instance
  // given a path to a package directory (.cipd/pkgs/<name>).
  //
  // It returns ("", nil) if no package is installed there.