You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: io.go
    path of file: ./repos/lakeFS/pkg/fileutil
    
    the code of the file until where you have to start completion: package fileutil

import (
	"errors"
	"fmt"
	"io"
	"io/fs"
	"os"
	"path/filepath"
	"strings"
)

const (
	DefaultDirectoryMask = 0o755
)

var (
	ErrNotFile      = errors.New("path is not a file")
	ErrBadPath      = errors.New("bad path travers
    
func PruneEmptyDirectories(dirPath string) ([]string, error) {
	// Check if the directory exists
	info, err := os.Stat(dirPath)
	if err != nil {
		return nil, err
	}

	// Skip if it's not a directory
	if !info.IsDir() {
		return nil, nil
	}

	// Read the directory contents
	entries, err := os.ReadDir(dirPath)
	if err != nil {
		return nil, err
	}

	// Recurse through the directory entries
	var pruned []string
	for _, entry := range entries {
		if !entry.IsDir() {
			continue
		}

		subDirPath := filepath.Join(dirPath, entry.Name())
		prunedDirs, err := PruneEmptyDirectories(subDirPath)
		if err != nil {
			return nil, err
		}
		// Collect the pruned directories
		pruned = append(pruned, prunedDirs...)

		// Re-read the directory contents to check if it's empty now
		empty, err := IsDirEmpty(subDirPath)
		if err != nil {
			return nil, err
		}
		if empty {
			err = os.Remove(subDirPath)
			if err != nil {
				return nil, err
			}
			pruned = append(pruned, subDirPath)
		}
	}

	return pruned, nil
}