pkg/osutil: fix IsExist

Currently it returns true for "/some/existing/file/foo"
because that returns ENOTDIR.
This commit is contained in:
Dmitry Vyukov 2017-06-19 16:44:39 +02:00
parent b6e969be7a
commit 4799d21e01

View File

@ -74,7 +74,7 @@ func Abs(path string) string {
// IsExist returns true if the file name exists. // IsExist returns true if the file name exists.
func IsExist(name string) bool { func IsExist(name string) bool {
_, err := os.Stat(name) _, err := os.Stat(name)
return err == nil || !os.IsNotExist(err) return err == nil
} }
// HandleInterrupts closes shutdown chan on first SIGINT // HandleInterrupts closes shutdown chan on first SIGINT