func Directory(path string) (fs.Directory, error) {
	e, err := NewEntry(path)
	if err != nil {
		return nil, err
	}

	switch e := e.(type) {
	case *filesystemDirectory:
		return e, nil

	case *filesystemSymlink:
		// it's a symbolic link, possibly to a directory, it may work or we may get a ReadDir() error.
		// this is apparently how VSS mounted snapshots appear on Windows and attempts to os.Readlink() fail on them.
		return &filesystemDirectory{e.filesystemEntry}, nil

	default:
		return nil, errors.Errorf("not a directory: %v (was %T)", path, e)
	}
}
// Directory returns fs.Directory for the specified path.
Directory returns fs.Directory for the specified path.
// Directory returns fs . Directory for the specified path .
func Directory(path string) (fs.Directory, error) {
	e, err := NewEntry(path)
	if err != nil {
		return nil, err
	}
	switch e := e.(type) {
	case *filesystemDirectory:
		return e, nil
	case *filesystemSymlink:
		return &filesystemDirectory{e.filesystemEntry}, nil
	default:
		return nil, errors.Errorf("not a directory: %v (was %T)", path, e)
	}
}
func Directory ( path string ) ( fs . Directory , error ) { e , err := NewEntry ( path ) if err != nil { return nil , err } switch e := e . ( type ) { case * filesystemDirectory : return e , nil case * filesystemSymlink : return & filesystemDirectory { e . filesystemEntry } , nil default : return nil , errors . Errorf ( " " , path , e ) } }
Directory returns fs.Directory for the specified path.
Directory returns fs . Directory for the specified path .
// it's a symbolic link, possibly to a directory, it may work or we may get a ReadDir() error. // this is apparently how VSS mounted snapshots appear on Windows and attempts to os.Readlink() fail on them.