code: func ReadSymlinkedDirectory(path string) (string, error) {
  	var realPath string
  	var err error
  	if realPath, err = filepath.Abs(path); err != nil {
  		return "", fmt.Errorf("unable to get absolute path for %s: %s", path, err)
  	}
  	if realPath, err = filepath.EvalSymlinks(realPath); err != nil {
  		return "", fmt.Errorf("failed to canonicalise path for %s: %s", path, err)
  	}
  	realPathInfo, err := os.Stat(realPath)
  	if err != nil {
  		return "", fmt.Errorf("failed to stat target '%s' of '%s': %s", realPath, path, err)
  	}
  	if !realPathInfo.Mode().IsDir() {
  		return "", fmt.Errorf("canonical path points to a file '%s'", realPath)
  	}
  	return realPath, nil
  }
docs: // ReadSymlinkedDirectory returns the target directory of a symlink.
  // The target of the symbolic link may not be a file.