code: func ReplaceDir(fs utilfs.Filesystem, path string, files map[string]string) error {
  	// write data to a temporary directory
  	tmpPath, err := WriteTempDir(fs, path, files)
  	if err != nil {
  		return err
  	}
  	// rename over target directory
  	return fs.Rename(tmpPath, path)
  }
docs: // ReplaceDir replaces the contents of the dir at `path` with `files` by writing to a tmp dir in the same
  // dir as `path` and renaming the tmp dir over `path`. The dir does not have to exist to use ReplaceDir.