code: func getAllParentLinks(path string) ([]string, error) {
  	const maxIter = 255
  	links := []string{}
  	for {
  		links = append(links, path)
  		if len(links) > maxIter {
  			return links, fmt.Errorf("unexpected length of parent links: %v", links)
  		}
  
  		fi, err := os.Lstat(path)
  		if err != nil {
  			return links, fmt.Errorf("Lstat: %v", err)
  		}
  		if fi.Mode()&os.ModeSymlink == 0 {
  			break
  		}
  
  		path, err = os.Readlink(path)
  		if err != nil {
  			return links, fmt.Errorf("Readlink error: %v", err)
  		}
  	}
  
  	return links, nil
  }
docs: // getAllParentLinks walks all symbolic links and return all the parent targets recursively