code: func dirEmpty(dirPath string) (bool, error) {
  	f, err := os.Open(dirPath)
  	if err != nil {
  		return false, err
  	}
  	defer f.Close()
  
  	// Read the names of a max of one entry from the directory.  When the
  	// directory is empty, an io.EOF error will be returned, so allow it.
  	names, err := f.Readdirnames(1)
  	if err != nil && err != io.EOF {
  		return false, err
  	}
  
  	return len(names) == 0, nil
  }
docs: // dirEmpty returns whether or not the specified directory path is empty.