func (de Dirent) IsDirOrSymlinkToDir() (bool, error) {
	if de.IsDir() {
		return true, nil
	}
	if !de.IsSymlink() {
		return false, nil
	}
	info, err := os.Stat(filepath.Join(de.path, de.name))
	if err != nil {
		return false, err
	}
	return info.IsDir(), nil
}
IsDirOrSymlinkToDir returns true if and only if the Dirent represents a file
system directory, or a symbolic link to a directory. Note that if the Dirent
is not a directory but is a symbolic link, this method will resolve by
sending a request to the operating system to follow the symbolic link.
package godirwalk
import (
	"os"
	"path/filepath"
)
type Dirent struct {
	name     string       
	path     string       
	modeType os.FileMode  
}
func NewDirent(osPathname string) (*Dirent, error) {
	modeType, err := modeType(osPathname)
	if err != nil {
		return nil, err
	}
	return &Dirent{
		name:     filepath.Base(osPathname),
		path:     filepath.Dir(osPathname),
		modeType: modeType,
	}, nil
}
func (de Dirent) IsDir() bool { return de.modeType&os.ModeDir != 0 }