// isDirectory tests whether the given path exists and is a directory. It
// follows symlinks.
isDirectory tests whether the given path exists and is a directory. It
follows symlinks.
// isDirectory tests whether the given path exists and is a directory . It // follows symlinks .
func isDirectory(path string) error {
	path, err := resolveHomeDir(path)
	if err != nil {
		return err
	}
	info, err := os.Stat(path)
	if err != nil {
		return err
	}
	if !info.Mode().IsDir() {
		return &os.PathError{
			Op:   "stat",
			Path: path,
			Err:  syscall.ENOTDIR,
		}
	}
	return nil
}
func isDirectory ( path string ) error { path , err := resolveHomeDir ( path ) if err != nil { return err } info , err := os . Stat ( path ) if err != nil { return err } if ! info . Mode ( ) . IsDir ( ) { return & os . PathError { Op : " " , Path : path , Err : syscall . ENOTDIR , } } return nil }
isDirectory tests whether the given path exists and is a directory.
isDirectory tests whether the given path exists and is a directory .
// Return a PathError to be consistent with os.Stat().