directory.go 206 字节
Newer Older
G
Grant Yin 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
package tools

import "os"

func PathExists(path string) (bool, error) {
	_, err := os.Stat(path)
	if err == nil {
		return true, nil
	}
	if os.IsNotExist(err) {
		return false, nil
	}
	return false, err
}