code: func scanPackageDir(ctx context.Context, dir string) ([]pkg.FileInfo, error) {
  	out := []pkg.FileInfo{}
  	err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
  		if err != nil {
  			return err
  		}
  		rel, err := filepath.Rel(dir, path)
  		if err != nil {
  			return err
  		}
  		if rel == pkg.ServiceDir || rel == fs.SiteServiceDir {
  			return filepath.SkipDir
  		}
  		if info.Mode().IsRegular() || info.Mode()&os.ModeSymlink != 0 {
  			symlink := ""
  			ok := true
  			if info.Mode()&os.ModeSymlink != 0 {
  				symlink, err = os.Readlink(path)
  				if err != nil {
  					logging.Warningf(ctx, "Can't readlink %q, skipping: %s", path, err)
  					ok = false
  				}
  			}
  			if ok {
  				out = append(out, pkg.FileInfo{
  					Name:       filepath.ToSlash(rel),
  					Size:       uint64(info.Size()),
  					Executable: (info.Mode().Perm() & 0111) != 0,
  					Symlink:    symlink,
  				})
  			}
  		}
  		return nil
  	})
  	return out, err
  }
docs: // scanPackageDir finds a set of regular files (and symlinks) in a package
  // instance directory and returns them as FileInfo structs (with slash-separated
  // paths relative to dir directory). Skips package service directories (.cipdpkg
  // and .cipd) since they contain package deployer gut files, not something that
  // needs to be deployed.