17 lines · 364 B · Go
RawDownload
package check import (	"fmt"	"os") // Dir checks the given path, will return error if path not exists or path// is not directory.func Dir(path string) error {	if info, err := os.Stat(path); err != nil {		return fmt.Errorf(`directory not exists: %s`, path)	} else if !info.IsDir() {		return fmt.Errorf(`path is not directory: %s`, path)	}	return nil}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t